#include<iostream>
#include<cmath>
#include<iomanip>
#include<fstream>
using namespace std;
int main()
{
	ifstream f1("DE001.INP");
	int a,b;
	f1>>a>>b;
	f1.close();
	ofstream f2("DE001.OUT");
	if(a=b) f2<<1<<" "<<1;
	else{
		if(a>b) {
		a=a-b;
		if(a=b) f2<<a/a<<" "<<b/b;
		}
		if(a<b) {
			b=b-a;
			if(a=b) f2<<a/b<<" "<<b/b;
		}
	}
	f2.close();
}
