#include <bits/stdc++.h>

using namespace std;

const int RADIX = 4;

void transfer(int n) {
	string Result;

	do {
		Result += n % RADIX + '0';
		n /= RADIX;
	} while (n);

	reverse(Result.begin(), Result.end());
	cout << Result << endl;
}

int main() {
	int n;
	
	while (cin >> n, n != -1) {
		transfer(n);
	}
	
	return 0;
}
