#include <iostream>
#include <vector>
using namespace std;
int main()
{
  int n;
  vector<int> v;
  vector<int>::reverse_iterator it;
  for(;;){
    cin >> n;
    if(n < 0) break;
    if(n == 0){
      cout << "0" << endl;
      continue;
    }
    v.clear();
    while(n != 0){
      v.push_back(n%4);
      n /= 4;
    }
    it = v.rbegin();
    while(it != v.rend()){
      cout << (*it);
      it++;
    }
    cout << endl;
  }
  return 0;
}