#include <iostream>
#include <array>

using namespace std;

array< int, 10 > weight_array{ 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 };
array< int, 1024 > sum_table;
array< array< int, 10 >, 1024 > bit_table;

void MakeTable()
{
	int i = 0, j = 0, tmp = 0;
	for ( i = 0 ; i < 1023 ; i++ )
	{
		tmp = i;
		for ( j = 0 ; j < 9 ; j++ )
		{
			sum_table[i] = ( tmp % 2 ) * weight_array[j] + sum_table[i];
			bit_table[i][j] = tmp % 2;
			tmp = tmp >> 1;
		}
	}
}

int main()
{
	int weight, j, i;
	MakeTable();

	cin >> weight;
	for ( i = 0 ; i < 1024 ; i++ )
	{
		if ( sum_table[i] == weight )
		{
			for ( j = 0 ; j < 10 ; j++ )
			{
				if ( bit_table[i][j] == 1 )
				{
					cout << weight_array[j];
				}
			}
			break;
		}
	}

	return 0;
}