#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,t;
	scanf("%f",a);
	b=a%10;
	c=a/10%10;
	d=a/100;
	t=a+b*1000+c*10000+d*100000;
	cout<<t;
}
/**************************************************************
	Problem: 1620
	User: tonghuawei
	Language: C++
	Result: Runtime Error
****************************************************************/