problem-2-10

Apples and Oranges. You thought this question was gone when you passed class 6th. WELL YOU ARE WRONG. It's back.

See we have n apples and m oranges. You need to put these apples and oranges into some boxes. Though we've put some terms&conditions with a bright *

1. Number of apples should be same in each box.

2. Number of oranges should be same in each box

3. Number of boxes should be greatest under the above two conditions

Input

First line contains n & m, two integers. n lies in 1 to 10^9. m lies in 1 to 10^9
Output
Number of apples and oranges in each box

Sample Input

12028 12772

Sample Output
97 103

 Explanation 
Seriously? Just look at the numbers. Try Harder. Again look at the numbers.

SAMPLE INPUT
12028 12772

SAMPLE OUTPUT
97 103

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
from fractions import gcd;

apple = input();
apple, oranges = apple.split();
apple = int(apple);
oranges = int(oranges);
g = gcd(apple, oranges);
line = str(""+str(apple/g) + " " + str(oranges/g));
print(line);


m=input()
for i in range(len(m)):
	if m[i]==' ':
		x,y=int(m[:i]),int(m[i+1:len(m)])
a,b=0,0
hcf=1
if x>y:
	a,b=x,y
else:
	a,b=y,x
while True:
	rem=a%b
	if rem==1:
		break
	if a%b==0:
		hcf=b
		break
	else:
		a=b
		b=rem
n1=x/hcf
n2=y/hcf
print(str(n1)+" "+str(n2))


def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)
a,b=list(map(int,input().split()))
c=gcd(a,b)
print(a/c,b/c)


a,b=input().split()
a=int(a)
b=int(b)
(c,d)=(a,b)
while(b!=0):
	(a,b)=(b,a%b)
print(c/a,d/a)	 


def gcd(x, y):
	while y:
		x, y = y, x%y
	return x

apple, orange = input().split()
apple, orange = int(apple), int(orange)

divisor = gcd(apple, orange)

print(apple/divisor, orange/divisor)


'''
Created on 21-Aug-2014

@author: sasi
'''

n,m=input().split()
n=int(n)
m=int(m)
p=min(m+1,n+1)
b=False
l=1
if(not((1<n<10**9) and (1<m<10**9))):
	b=True
while(not b and p>1):
    p=p-1
    if(m%p==0 and n%p==0):
        l=p
        b=True
        
num_box=l
print(n/num_box,m/num_box)



__author__ = 'hareesh'

def gcd(a,b):
	if(a%b==0):
		return b;
	return gcd(b,a%b)
var=list(map(int,input().split()))
num=gcd(var[0],var[1])
print(var[0]/num, var[1]/num)


from fractions import gcd
x, y = list(map(int, input().split()))
z = gcd(x, y)
print(x/z, y/z)