#!/usr/bin/env python3
import sys
import random

if len(sys.argv) > 5:
    n = int(sys.argv[1])
    q = int(sys.argv[2])
    max_a = int(sys.argv[3])
    max_k = int(sys.argv[4])
    seed = int(sys.argv[5])
    random.seed(seed)

max_b = min(316, int(max_a**0.5))
if max_b < 301:
    b = max_b
else:
    b = random.randint(301, max_b)

M = b * b

a = [M]
for _ in range(n - 1):
    a.append(random.randint(1, b - 1))
    
random.shuffle(a)

print(n, q)
print(*a)

for _ in range(q):
    print(b)

