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