#include <iostream>
#include <cassert>
#include <set>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  long long a, b, x, N; cin >> a >> b >> x >> N;
  long long x1 = a * x + b;
  if (x1 & 1) {
    cout << 0 << ' ' << N / 2 << endl;
  } else {
  	cout << N / 2 << ' ' << 0 << endl;
  }
  return 0;
}