import sys sys.setrecursionlimit(10 ** 7) def get_list(ty=int): return list(map(ty, input().split())) def get_int(): return int(input()) def get_str(): return input() V1, V2, V3, V4, N = get_list() V = [V1, V2, V3, V4] C = [0] * 4 C[0] = V[0] history = set([]) for n in range(N): a = n % 4 b = (n + 1) % 4 diff = min(V[b] - C[b], C[a]) C[a] -= diff C[b] += diff if tuple(C) in history and (n + 1) % 4 == N % 4: break history.add(tuple(C)) print(" ".join(str(c) for c in C))