#include <iostream>
using namespace std;
int main() {
    int n;
    while (cin>>n, ~n) {
        if (!n) { cout << 0 << endl; continue; }
        int i = 1<<20;
        while (n < i) i >>= 2;
        for (; i>=1; i>>=2) { cout << n / i; n %= i; }
        cout << endl;
    }
    return 0;
}