import sys input = sys.stdin.readline T, N, Money = map(int, input().split()) S, P, R = [0]*N, [0]*N, [0]*N for t in range(T): for x in range(1, 6): if 500000 * 2**(x-1) > Money // 2: x -= 1 break if x > 0: print(2, x, flush=True) else: P = [max(p, 0) for p in P] k = Money // (500 * sum(P)) L = [k * p for p in P] print(1, *L, flush=True) 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()))