def main(): T, N, M = map(int, input().split()) for w in range(T): if w == 0: print("2 1", flush=True) else: m = M // 500 W = [max(0, P[i]) for i in range(N)] s_W = sum(W) L = [(m // 2) * W[i] // s_W + (m // (2 * N)) for i in range(N)] print(1, *L, flush=True) M = int(input()) S = list(map(int, input().split())) P = list(map(int, input().split())) R = list(map(int, input().split())) return 0 main()