import sys input = sys.stdin.readline A,B,C,D,N=map(int,input().split()) P,Q,R,S,T=map(int,input().split()) for x in range(A+1): for y in range(B+1): # z+w=N-x-y # z*R+w*S=T-x*P-y*Q # z*R+(N-x-y-z)*S=T-x*P-y*Q # z*(R-S) = T-x*P-y*Q - (N-x-y)*S if R==S: if T-x*P-y*Q - (N-x-y)*S==0: z=min(N-x-y,C) w=N-x-y-z if 0<=z<=C and 0<=w<=D: print(x,y,z,w) exit() else: if (T-x*P-y*Q - (N-x-y)*S)%(R-S)==0: z=(T-x*P-y*Q - (N-x-y)*S)//(R-S) w=N-x-y-z if 0<=z<=C and 0<=w<=D: print(x,y,z,w) exit()