#include<iostream>
#include<string>
#include<algorithm>
using namespace std;


int main(){
	int n;
	while(cin>>n,~n){
		string s;
		do{
			int a=n&3;
			s+=+a+'0';
			n>>=2;
		}while(n);
		reverse(s.begin(),s.end());
		cout<<s<<endl;
	}
	return 0;
}