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 = 2; j < i -1; j++) { var w = (int)Math.Pow(2, j - 1) * (i - j) * (i - j - 1); if (w == k) { putAns(i, j); break; } } } 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)); } }