#include <iostream>
using namespace std;
int main(){
int x;
cin>>x;
int bw,sw,gw;
bw=x/100;
sw=x/10%10;
gw=x%10;
cout<<gw*100000+sw*10000+bw*1000+bw*100+sw*10+gw;
return 0;
}
/**************************************************************
Problem: 1620
User: admin
Language: C++
Result: Accepted
Time:8 ms
Memory:2072 kb
****************************************************************/