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

n = int(sys.argv[1])
seed = int(sys.argv[2])

random.seed(seed)

q = 100000
k = 1_000_000_000

print(n, q)

a = [i + 1 for i in range(n)]
print(*a)

for i in range(q):
    if i % 1000 == 0:
        print(random.randint(1, k))
    else:
        print(k - i)