#include using namespace std; int main() { string S; while(cin >> S) { reverse(S.begin(),S.end()); S[0]++; for(int i =0; i < S.length(); i++) if(S[i] >= '2') { int x =(S[i]-'0')/2; int y =(i+1 == S.length())?0:(S[i+1]-'0'); int z =min(x,y); if(z > 0) { S[i] -=2*z; S[i+1] -=z; x -=z;} S[i] ='0'+(S[i]-'0')%2; while(i+2 >= S.length()) S +='0'; S[i+1] +=x; S[i+2] +=x;} while(S.length() > 1 && *S.rbegin() == '0') S.erase(--S.end()); reverse(S.begin(),S.end()); cout << S << "\n";} }