#include<cstdio>
int main(){
  int n,f,ans;
  while(scanf("%d",&n),n>=0){
    ans=0;
    f=1;
    while(n>=f*4) f*=4;
    while(f > 0){
      printf("%d",n/f);
      n %= f;
      f /= 4;
    }
    printf("\n");
  }
  return(0);
}

