#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; long long x = gcd(a, gcd(b, gcd(c, d))); if (x == 0) { cout << 0 << ' ' << 0 << endl; } else { cout << x << ' ' << abs(a * d - b * c) / x << endl; } return 0; }