#include<iostream> using namespace std; int main(){ int n,s=0; while(cin>>n){ s=0; while(n){ s+=s*10+n%10; n/=10; } cout<<s<<endl; } return 0; }