#include<iostream>
using namespace std;

int main(){
	int n;
	int ans[30];
	int hoge;
	while(cin >> n, 0 <= n){
		for(int i=0; i < 30; i++){
			hoge = i;
			ans[i] = n%4;
			if(n < 4) break;
			n /= 4;
		}
		for(int i=hoge; 0 <= i; i--){
			cout << ans[i];
		}
		cout << endl;
	}
}