import std.algorithm; import std.array; import std.conv; import std.math; import std.range; import std.stdio; import std.string; import std.typecons; T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int; void calc(int k) { for (int i = 2; i <= 30; i++) { for (int j = 0; j <= 30; j++) { if (i + j > 30) break; long a = i * (i - 1) / 2; long b = 2 ^^ j; if (a * b == k) { auto ans = chain(replicate([1], i), replicate([0], j)); writeln(ans.count); writeln(ans.map!(e => e.to!string).join(" ")); return; } } } // not found writeln(1); writeln(0); } void main() { int k = readint; calc(k); }