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] def gutyoku(V): C = [0] * 4 C[0] = V[0] 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 return C print(" ".join(str(c) for c in gutyoku(V)))