#include <iostream>
    #include <iomanip>
    #include <algorithm>
    #include <numeric>
    #include <cmath>
    #include <vector>
    #include <list>
    #include <stack>
    #include <queue>
    #include <deque>
    #include <set>
    #include <map>
    #include <tuple>
    using namespace std;

    int main(){

        long long n; cin >> n;

        if(n == 0){
            cout << 0;
        }
        else if(n > 0){

            long long n2[37];
            n2[0] = 1;
            for(int i=1; i<=36; i++){
                n2[i] = 2LL*n2[i-1];
            }

            int temp = 0;
            int itemp = -2;
            int firstnum;
            int base;
            while(temp < n){
                itemp += 2;
                temp += n2[itemp];
            }
            firstnum = n2[itemp];
            base = temp - n2[itemp];
            int pos = n - base - 1;
            int div = temp - base;

            vector<int> ans;
            ans.push_back(1);

            int cnt = 1;
            while(div != 1){
                if(cnt % 2 == 1){
                    if(pos/(div/2) == 0){
                        ans.push_back(1);
                    }
                    else{
                        pos -= div/2;
                        ans.push_back(0);
                    }
                } 
                else{
                    if(pos/(div/2) == 0){
                        ans.push_back(0);
                    }
                    else{
                        pos -= div/2;
                        ans.push_back(1);
                    }
                }
                cnt++;
                div /= 2;
            }

            for(int i=0; i<ans.size(); i++){
                cout << ans[i];
            }
        }
        else if(n < 0){

            n = -n;

            long long n2[37];
            n2[0] = 1;
            for(int i=1; i<=36; i++){
                n2[i] = 2LL*n2[i-1];
            }

            long long temp = 0;
            int itemp = -1;
            int firstnum;
            int base;
            while(temp < n){
                itemp += 2;
                temp += n2[itemp];
                // cout << temp << " " << n << " " << n - temp << endl;
            }
            firstnum = n2[itemp];
            base = temp - n2[itemp];
            int pos = n - base - 1;
            long long div = temp - base;

            // cout << pos << " " << div << " " << base << endl;

            vector<int> ans;
            ans.push_back(1);

            int cnt = 1;
            while(div != 1){
                if(cnt % 2 == 1){
                    if(pos/(div/2) == 0){
                        ans.push_back(1);
                    }
                    else{
                        pos -= div/2;
                        ans.push_back(0);
                    }
                } 
                else{
                    if(pos/(div/2) == 0){
                        ans.push_back(0);
                    }
                    else{
                        pos -= div/2;
                        ans.push_back(1);
                    }
                }
                cnt++;
                div /= 2;
            }

            for(int i=0; i<ans.size(); i++){
                cout << ans[i];
            }

        }

        return 0;
    }

Measured memory_bytes: 256