money = 2000000 T, N = map(int, input().split()) s, p, r = [0] * N, [0] * N, [0] * N def do(l, x): print(1, *l) print(2, x) money = int(input()) if money == -1: exit() s = list(map(int, input().split())) p = list(map(int, input().split())) r = list(map(int, input().split())) for week in range(T): s, p, r = do([money // (500 * N)] * N, 1)