import sys from collections import defaultdict 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 smart(V): C = [0] * 4 C[0] = V[0] history = defaultdict(int) 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 history[tuple(C)] >= 100 and (n + 1) % 4 == N % 4: break history[tuple(C)] += 1 return C print(" ".join(str(c) for c in smart(V)))