#include<iostream>
#include<vector>

int main()
{
	int n;
	while( std::cin >> n, ~n )
	{
		std::vector<int> v;

		if( !n )
			v.push_back( 0 );

		while( n > 0 )
		{
			v.push_back( n & 3 );
			n >>= 2;
		}

		for( int i = v.size() - 1; i >= 0; --i )
			std::cout << v[i];
		std::cout << std::endl;
	}

	return 0;
}