#include <bits/stdc++.h>
using namespace std;
int main ()
{
	ifstream f("BAI1_17.inp");
	ofstream g("BAI1_17.out");
	long long a,b,k,l;
	f>>a>>b;
	k=a; l=b;
	while (a != b)
	{
        if (a > b)
		{
            a = a - b;
        }
		else
		{
            b = b- a;
        }
    }
    g<<k/a<<' '<<l/a;
    f.close();
    g.close();
}
		
	
	
