#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

void solve() {
  ll n = 2, g = -1;
  vector a(2, vector<ll>(2));
  rep(i, n) rep(j, n) {
    cin >> a[i][j];
    if (a[i][j] != 0) {
      if (g == -1) {
        g = abs(a[i][j]);
      } else {
        g = __gcd(g, abs(a[i][j]));
      }
    }
  }
  if (g == -1) {
    cout << "0 0\n";
    return;
  }
  ll det = a[0][0] * a[1][1] - a[0][1] * a[1][0];
  cout << g << ' ' << abs(det) / g << '\n';
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  int T = 1;
  for (int t = 0; t < T; t++) {
    solve();
  }
  return 0;
}