#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define f first
#define s second
using namespace std;

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n; cin >> n;
    if(n == 0){
        cout << 0 << endl; return 0;
    }
    string bin = "";
    while(n != 0){
        ll foo = n%((ll)-2);
        n /= ((ll)-2);
        if(foo < 0){
            foo += abs((ll)-2);
            n++;
        }
        bin = to_string(foo)+bin;
    }
    cout << bin << endl;
    return 0;
}

#include <bits/stdc++.h>

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

int main() {
    int64_t n;
    cin >> n;

    if (n == 0) {
        cout << 0 << endl;
        return 0;
    }

    vector<int64_t> ans;
    while (n != 0) {
        if (n % 2 != 0) {
            ans.push_back(1);
            --n;
        } else {
            ans.push_back(0);
        }
        n /= -2;
    }

    for (auto a : ans | reversed) {
        cout << a;
    }
    cout << endl;
}