#include<bits/stdc++.h> using namespace std; int main(){ int q; cin>>q; int w=(q/100%10)*1000+(q/1000%10)*100+(q%10)*10+q/10%10; cout<<w; return 0; }