#include<iostream>
#include<vector>
using namespace std;

int main(){
  int n;
  vector<int> ans;

  while(1){
    cin >> n;
    if(n<0)break;

    ans.clear();
    while(n/4){
      ans.push_back(n%4);
      n/=4;
    }
    ans.push_back(n);
    
    for(int i=ans.size()-1;i>=0;i--)cout << ans[i];
    cout << endl;
  }
}