#include<bits/stdc++.h> using namespace std; int main(){ int h =2, w = 2; vector<vector<long long>> a(h, vector<long long>(w)); for(int i=0; i<h; i++){ for(int j=0; j<w; j++){ cin >> a[i][j]; } } long long gcd = 0; for(int i=0; i<h; i++){ for(int j=0; j<w; j++){ if(a[i][j] == 0) continue; if(gcd == 0) gcd = abs(a[i][j]); gcd = __gcd(gcd, abs(a[i][j])); } } long long det = abs(a[0][0]*a[1][1] - a[0][1]*a[1][0]); cout << gcd << " " << (gcd == 0 ? 0 : det/gcd) << endl; }