T,N,Money=map(int,input().split()) SELLS=[1]*N S = [0] * N P = [0] * N R = [0] * N for tests in range(T): ALL=Money//500 ALL=min(ALL,500) SUM=sum(SELLS) ANS=[0]*N for i in range(N): ANS[i]=ALL*SELLS[i]//SUM if Money>=8500000: print(2,5,flush=True) elif Money>=4500000: print(2,4,flush=True) elif Money>=2500000: print(2,3,flush=True) elif tests!=0 and Money>=1500000: print(2,2,flush=True) else: print("1",*ANS,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())) for i in range(N): SELLS[i]+=S[i]