#求最大公约数和最小公倍数 m,n =map(int,input().split()) if m<n : m,n =n,m p=m*n r=m%n while r!=0: m=n n=r r=m%n print(n,p//n)