#include<iostream> using namespace std; #include<vector> #include<algorithm> //高精度除法 vector<int> div(vector<int>& A,int b,int &r) { r = 0; vector<int>ans; for(int i = A.size() - 1;i >= 0;i--) { r = r * 10 + A[i]; ans.push_back(r / b); r %= b; } reverse(ans.begin(),ans.end()); while(ans.size() > 1 && ans.back() == 0) ans.pop_back(); return ans; } string converse(vector<int>A) { int r = 0; string ans = "0"; while(!(A.size() == 1 && A[0] == 0)) { A = div(A,2,r); ans.push_back(r + '0'); } reverse(ans.begin(),ans.end()); if(ans != "0")ans.pop_back(); return ans; } int main(void) { string a; while(cin >> a) { vector<int>A; for(int i = a.size() - 1;i >= 0;i --) A.push_back(a[i] - '0'); string ans = converse(A); cout << ans << endl; } return 0; }