#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; ll a, b, x, N; int main() { cin >> a >> b >> x >> N; ll x1 = a * x + b; if (x1 & 1) { cout << 0 << ' ' << N / 2 << endl; } else { cout << N / 2 << ' ' << 0 << endl; } return 0; }