V = list(map(int, input().split())) N = V.pop() m = min(V) ans = [0] * 4 for i in range(4): V[i] -= m ans[0] = V[0] for i in range(min(N, 1000)): d = min(V[(i+1)%4] - ans[(i+1)%4], ans[i%4]) ans[i%4] -= d ans[(i+1)%4] += d ans[N%4] += m print(*ans)