#include<iostream>
using namespace std;
int main(){
  int n,wm;
  long long n4;
  while(1){
    wm=262144;
    n4=0;
    cin >> n;
    if(n<0)break;
    for(int i=0;wm!=1;i++){
      n4*=10;
      if(n/wm!=0){
	n4+=n/wm;
	n%=wm;
      }
      wm/=4;
    }
    n4*=10;
    if(n!=0){
      n4+=n;
    }
    cout << n4 << endl;
  }
  return 0;
}