T, N, Money = map(int, input().split()) S, P, R = [0]*N, [0]*N, [0]*N for week in range(T): if week == 0: x = 1 print(2, x) else: P = [max(p, 1) if p <= 3 else 3 + p//10 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()))