#include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	string s;
	while(cin>>n,n+1){
		s="";
		do{
			s = (char)('0'+n%4) + s;
			n = (n - (n%4)) / 4;
		}while(n);
		cout<<s<<endl;
	}
}