#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,x,z,s;
int main(){
cin>>x;
a=x%10;
b=x/10%10;
c=x/100%10;
s=x/1000%10;
z=a*100+b*1000+c+s*10;
cout<<z;
}
/**************************************************************
Problem: 1616
User: chenyichuen
Language: C++
Result: Accepted
Time:16 ms
Memory:2072 kb
****************************************************************/