import random
import sys
MAXN = int(sys.argv[1])
MAXVAL = int(sys.argv[2])

N = random.randint(max(1, MAXN * 9 / 10), MAXN)
print N, random.randint(1, MAXVAL)

print ' '.join(map(str, [random.randint(0, MAXVAL) for i in xrange(N)]))
print ' '.join(map(str, [random.randint(0, MAXVAL) for i in xrange(N)]))
