#!/usr/bin/env python3
from random import choice, choices, randint, sample, seed, shuffle
import sys


MX = 100000
seed(int(sys.argv[1]))

# on one side all the points, on the other side all the lines
perxy = [[*range(0,MX//2)], [*range(MX//2-2,MX-2)]]
lab = set() 
while len(lab)<MX+100:
    lab.add(randint(1,10**9))
lab = sorted(lab)
shuffle(lab)
    
shuffle(perxy)
print(2)
for es in perxy:
    es = [lab[i] for i in es]
    shuffle(es)
    print(len(es),*es)
