#include <iostream>
#include <stack>
using namespace std;

int main(void)
{
	int n;

	while(cin >> n, n >= 0){
		if(!n){
			cout << n << endl;
			continue;
		}
		stack<int> sta;
		while(n > 0){
			sta.push(n%4);
			n /= 4;
		}
		while(sta.size()){
			cout << sta.top();
			sta.pop();
		}
		cout << endl;
	}
	return 0;
}