#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	long long x;
	while(cin>>x&&x!=-1){
	long long z[100000],cnt=0;
	while(true){
		if(x<4)break;
		z[cnt]=x%4;
		x=(x-x%4)/4;
		cnt++;
	}
	z[cnt]=x;
	for(long long i=cnt;i>=0;i--){
		if(z[i]==0)cout<<"0";
		else cout<<z[i];
	}
	cout<<endl;
	}
	return 0;
}