#include <bits/stdc++.h>
using namespace std;
int bcnn(int x,int y)
{
	int i = 1;
	while ( (x*i)% y != 0)
	{
		i++;
	}
	return x*i;
}
int main()
{
    ifstream f1("CAU1_14.inp");
    ofstream f2("CAU1_14.out");
    int a,b,x,y;
    f1>>a>>b>>x>>y;
    int c,d,bc;
    bc=bcnn(b,y);
    c=bc/b;
    d=bc/y;
    int e;
    e=a*c-x*d;
    int i;
    i=e*bc/bcnn(e,bc);
    f2<<e/i<<" "<<bc/i;
}
