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:
                print(x,y,N-x-y,0)
                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 z>=0 and w>=0:
                    print(x,y,z,w)
                    exit()