/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	static List<Integer> bits(int num) {
		List<Integer> setBits = new ArrayList<>();
		for (int i = 1; num != 0; ++i, num >>>= 1) {
			if ((num & 1) != 0) setBits.add(i);
		}
		return setBits;
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		System.out.println(6 + " " + bits(6));
		System.out.println(7 + " " + bits(7));
		System.out.println(8 + " " + bits(8));
		System.out.println(-1 + " " + bits(-1));
	}
}