#include<stdio.h>

int main(){

int x;

while(1){

scanf("%d",&x);if(x==-1)break;
unsigned long s=0;int k=0;int p=1;
int n[1000]={};int P=0;
while(1){
k=x%4;
//s+=k*p;
n[P]=k;
x=x/4;
if(x==0)break;
p=p*10;P++;
}
for(int i=P;i>=0;i--)
	printf("%d",n[i]);
printf("\n");

//printf("%ld\n",(unsigned long)s);
}
return 0;
}