A,B,C,X,Y = map(int,input().split())

minValue = float('inf')

for x in range(X+1):
    for y in range(Y+1):
        total = A * x + B * y
        if X > x or Y > y:
            if X - x > Y - y:
                total += 2 * (X - x) * C
                Z = 2 * (X - x)
            else:
                total += 2 * (Y - y) * C
                Z = 2 * (X - x)
        if total < minValue:
            minValue = total
            print(X,Y,Z)

print(minValue)
