#include <bits/stdc++.h>
using namespace std;
struct ps
{long long tu;
 long long mau;
};
long long ucln(long long a, long long b)
{
    while (b>0)
    {long long r=a%b;
     a=b;
     b=r;
	}
	return a;}

int main()
{
  ifstream s1("CAU1_14.INP");
  ofstream s2("CAU1_14.OUT");
   long long a,b,c,d,x,g,h;
   s1>>a>>b>>c>>d;;
 ps f1={a,b};
 ps f2={c,d};
 ps hieu={(f1.tu*f2.mau)-(f2.tu*f1.mau),f1.mau*f2.mau};
 if (hieu.mau<0)
 { hieu.mau=-hieu.mau;}
 if (hieu.tu<0)
 { x=-hieu.tu;
 g=-(x/ucln(x,hieu.mau));
 }
 else {x=hieu.tu;
  g=x/ucln(x,hieu.mau);}
  h=hieu.mau/ucln(x,hieu.mau);
 s2<<g<<" "<<h;
   return 0;
}
