#include<iostream>
#include<vector>

using namespace std;

int main(){
  int i, n, m, digit;
  vector<int> data;

  while(1){
    cin >> n;
    if(n == -1) break;

    if(n == 0) data.push_back(0);
    for(digit=4; n!=0; digit*=4){
      m = n % digit;
      data.push_back(m*4/digit);
      n = n - m;
    }

    for(i=data.size()-1; i>=0; --i)
      cout << data[i];
    cout << endl;

    data.clear();
  }

  return 0;
}