#include using namespace std; int main() { int64_t a, b, x, n; cin >> a >> b >> x >> n; int64_t l = (x % 2 ? n / 2 : 0); int64_t r = (x % 2 ? 0 : n / 2); cout << l << " " << r << '\n'; // int64_t ma = 0; // uint32_t a, b, x, n; cin >> a >> b >> x >> n; // for(int i = 1; i < 10000; ++i) { // x = a * x + b; // cout << x << " " << x % 2 << '\n'; // if(i % 2 == x % 2) { // cerr << "err " << i << '\n'; // } // } return 0; }