#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

string dec2four (int n)
{
	string res = "";

	while ( n > 0 ){
		res += n % 4 + '0';
		n /= 4;
	} // end while

	reverse (res.begin(), res.end() );

	return res;
}
int main()
{
//	cut here before submit 
//	freopen ("testcase.dec24", "r", stdin );
	string str = "";
	string res = "";
	int n;

	while (getline (cin, str ) ){
		stringstream ssn(str);
		ssn >> n;

		if (n == -1 ){
			break;
		} // end if
		if (n == 0){
			res = "0";
		}else{
			res = dec2four (n);
		} // end if

		cout << res << endl;
	} // end loop
		
	return 0;
}