#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,f,g;
	scanf("%d",&g);
	a=g%10;
	b=g/10%10;
	f=g/100%10;	
	d=g/1000;
	c=a*100+b*1000+f+d*10;
	cout<<c;
}
/**************************************************************
	Problem: 1616
	User: tonghuawei
	Language: C++
	Result: Accepted
	Time:10 ms
	Memory:2072 kb
****************************************************************/