#include <iostream>
using namespace std;

int main() {
  int n;
  while(cin >> n && (n>=0)) {
    string s;
    while(n>0) {
      s=(char)('0'+n%4)+s;
      n/=4;
    }
    if(s=="")s="0";
    cout << s << endl;
  }
  return 0;
}