using System; public class Hello { public static void Main() { var k = int.Parse(Console.ReadLine().Trim()); if (k == 0) { Console.WriteLine(1); Console.WriteLine(1); goto end; } if (k == 1) { Console.WriteLine(2); Console.WriteLine("1 1"); goto end; } for (int i = 2; i <= 30; i++) { for (int j = 0; j <= i-2; j++) { var w = Math.Pow(2, j) * ((i - j) * (i - j - 1) / 2); if (w == k) { putAns(i, j); goto end; } } } end:; } public static void putAns (int i, int j) { Console.WriteLine(i); var a = new int[i]; for (int x = 0; x < i - j; x++) a[x] = 1; Console.WriteLine(string.Join(" ",a)); } }