#include <bits/stdc++.h>
using namespace std;
int uc(int a,int b)
{
    int r;
    while(b>0)
    {
        r=a%b;
        a=b;
        b=r;
    }
    return a;
}
int main()
{
    int a,b,c,d;
    cin>>a>>b;
    cin>>c>>d;
    int t,m,x;
    t=a*d-b*c;
    m=b*d;
    x=uc(t,m);
    cout<<t/x<<" "<<m/x;
}
