#include<bits/stdc++.h>
using namespace std;
int64_t ucln(int64_t x, int64_t y)
{
    int64_t r;
    while (y!=0)
    {
        r=x%y;
        x=y;
        y=r;
    }
    return x;
}
int64_t bcnn(int64_t x, int64_t y)
{
    int64_t result=(x*y)/ucln(x,y);
    return result;
}
int main()
{
    ifstream fi("cau1_14.inp");
    ofstream fo("cau1_14.out");
    int64_t a,b,c,d;
    fi>>a>>b>>c>>d;
    int64_t ms=bcnn(b,d);
    int64_t ts=a*(ms/b)-c*(ms/d);
    int x, y;
    x=ts/ucln(ts,ms);
    y=ms/ucln(ts,ms);
    if(y<0)
    {
        x=x*-1;
        y=y*-1;
    }
    fo<<x<<' '<<y;
}
