#include <bits/stdc++.h> using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); long long a[2][2]; cin >> a[0][0] >> a[0][1] >> a[1][0] >> a[1][1]; long long g = 0; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (a[i][j]) { g = gcd(g, abs(a[i][j])); } } } long long d = abs(a[0][0] * a[1][1] - a[0][1] * a[1][0]); if (g == 0) { cout << 0 << " " << 0 << endl; } else { cout << g << " " << d / g << endl; } }