#include<iostream>
#include<fstream>
using namespace std;
int main ()
{
	ifstream f1("DE002_2.inp");
	ofstream f2("DE002_2.out");
	int N,a,i;
	f1>>N;
    do {
a=N%2;
N=N/2;
a++;
}
while (N!=0);
for (i=a-1;i>=0;i--) f2<<i;
	 f1.close();
	 f2.close(); 
}
