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,50*(tests+1)) ANS=[0]*N for i in range(N): OK=1 NG=ALL+1 while OK+1=mid*0.3: OK=mid else: NG=mid ANS[i]=max(0,OK-R[i]) SUM=sum(ANS) if SUM>ALL: for i in range(N): ANS[i]=ALL*ANS[i]//SUM if Money>=8000000: print(2,5,flush=True) elif Money>=4000000: print(2,4,flush=True) elif tests>=5 and Money>=2000000: print(2,3,flush=True) elif tests>=5 and Money>=1000000: print(2,2,flush=True) elif tests>=5 and Money>=500000: print(2,1,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]