#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll A[2][2];

int main() {
    ll d = 0;
    for (int i = 0; i < 2; i ++)
        for (int j = 0; j < 2; j ++) {
            cin >> A[i][j];
            d = __gcd(d, abs(A[i][j]));
        }
    ll det = A[0][0] * A[1][1] - A[0][1] * A[1][0];
    det = abs(det);
    if (d == 0) {
        printf("0 0");
    } else {
        printf("%lld %lld", d, det / d);
    }
}