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