#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair int main() { int a, b, x, n; cin >> a >> b >> x >> n; if (n == 0) { cout << 0 << " " << 0 << endl; return 0; } int anst = n/2, ansa = n/2; if (x%2) { if (n%4 == 0) anst += 2; else if (n%4 == 3) anst++; if (n%4 == 0) ansa += 2; else if (n%4 >= 2) ansa++; } else { if (n%4 == 0) ansa += 2; else if (n%4 == 3) ansa++; if (n%4 == 0) anst += 2; else if (n%4 >= 2) anst++; } cout << ansa << " " << anst << endl; }