#include <bits/stdc++.h>
using namespace std;
int main()
{
   int n,t,s;
   cin>>n;
   t=n;
   s=0;
   while(t){
	t/=2
	s++;
	if(n-pow(2,s-1)<=pow(2,s)-n){
		cout<<pow(2,s-1);	
	}
	else{
		cout<<pow(2,s)
	}
   }
	return 0;
}

/**************************************************************
	Problem: 1075
	User: lzk
	Language: C++
	Result: Compile Error
****************************************************************/