#include using namespace std; const u32string utf8to32(const string &s){ u32string r;auto it=s.begin(); while(it!=s.end()){ uint8_t c0=*it++; if((c0&0x80)==0)r+=(uint32_t)c0; else if((c0&0xE0)==0xC0){uint8_t c1=*it++;r+=(uint32_t)(((c0&0x1F)<<6)|(c1&0x3F));} else if((c0&0xF0)==0xE0){uint8_t c1=*it++;uint8_t c2=*it++;r+=(uint32_t)(((c0&0x0F)<<12)|((c1&0x3F)<<6)|(c2&0x3F));} else if(0xF0<=c0&&c0<=0xF4){uint8_t c1=*it++;uint8_t c2=*it++;uint8_t c3=*it++;r+=(uint32_t)((c0<<16)|((c1&0x0F)<<12)|((c2&0x3F)<<6)|(c3&0x3F));} else throw; } return r; } const string utf32to8(const u32string &s){ string r;auto it=s.begin(); while(it!=s.end()){ uint32_t c0=*it++; if((c0&~0x7F)==0)r+=(uint8_t)c0; else if((c0&~0x7FF)==0){r+=(uint8_t)(0xC0|(c0>>6));r+=(uint8_t)(0x80|(c0&0x3F));} else if((c0&~0xFFFF)==0){r+=(uint8_t)(0xE0|(c0>>12));r+=(uint8_t)(0x80|((c0>>6)&0x3F));r+=(uint8_t)(0x80|(c0&0x3F));} else if(c0&0x1F0000){r+=(uint8_t)(0xF0|(c0>>18));r+=(uint8_t)(0x80|((c0>>12)&0x3F));r+=(uint8_t)(0x80|((c0>>6)&0x3F));r+=(uint8_t)(0x80|(c0&0x3F));} else throw; } return r; } int main(){ string s; cin >> s; u32string t = utf8to32(s); reverse(t.begin(), t.end()); cout << utf32to8(t) << endl; }