z = 500
m = 1000000007
k = pow (2, z, m) - 1
p = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 73, 79, 83, 89, 97]
a = [1] * z
v = 0
for d in range (1, 31)[::-1]:
while k >= 2 ** d - 1:
k -= 2 ** d - 1
for c in range (d):
a[v] = p[0]
v += 1
p = p[1:]
for i in range (z):
print a[i],
print
eiA9IDUwMAptID0gMTAwMDAwMDAwNwprID0gcG93ICgyLCB6LCBtKSAtIDEKCnAgPSBbMiwgMywgNSwgNywgMTEsIDEzLCAxNywgMTksIDIzLCAyOSwgMzEsIDM3LCA0MSwgNDMsIDQ3LCA1MywgNTksIDYxLCA2NywgNzMsIDc5LCA4MywgODksIDk3XQoKYSA9IFsxXSAqIHoKdiA9IDAKZm9yIGQgaW4gcmFuZ2UgKDEsIDMxKVs6Oi0xXToKCXdoaWxlIGsgPj0gMiAqKiBkIC0gMToKCQlrIC09IDIgKiogZCAtIDEKCQlmb3IgYyBpbiByYW5nZSAoZCk6CgkJCWFbdl0gPSBwWzBdCgkJCXYgKz0gMQoJCXAgPSBwWzE6XQoKZm9yIGkgaW4gcmFuZ2UgKHopOgoJcHJpbnQgYVtpXSwKcHJpbnQK