#include<iostream> #include<cstdio> #include<string> using namespace std; char mode(string number) { return (number[number.size() - 1] - '0') % 2 + '0'; } string binary(string number) { int remainder = 0; int temp; for (int i = 0; i < number.size(); ++i) { temp=number[i] - '0' + remainder * 10; number[i] = temp / 2 + '0'; remainder=temp%2; } int pos = 0; while (number[pos] == '0') { ++pos; } return number.substr(pos); } int main() { string str; while (cin >> str) { string resultant; while (str.size()!=0) { resultant.push_back(mode(str)); str=binary(str); } for (int i = resultant.size() - 1; i >= 0; --i) { printf("%c", resultant[i]); } printf("\n"); } return 0; }