#include using namespace std; int main(){ int V1, V2, V3, V4; long long N; cin >> V1 >> V2 >> V3 >> V4 >> N; vector V = {V1, V2, V3, V4}; vector A = {V1, 0, 0, 0}; int cnt = 0; while ((cnt + 1) * 4 <= N){ vector B = A; for (int i = 0; i < 4; i++){ int j = (i + 1) % 4; int x = min(B[i], V[j] - B[j]); B[i] -= x; B[j] += x; } if (A == B){ break; } cnt++; swap(A, B); } for (int i = 0; i < N % 4; i++){ int j = i + 1; int x = min(A[i], V[j] - A[j]); A[i] -= x; A[j] += x; } for (int i = 0; i < 4; i++){ cout << A[i]; if (i < 3){ cout << ' '; } } cout << endl; }