Go: package main

import "fmt"

func main() {
	for {
		var x, y int
		fmt.Scanf("%d %d", &x, &y)
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		fmt.Printf("%d %d\n", y, lcm/y)
	}
}

Python: import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

while True:
    try:
        a, b = map(int, input().split())
        print('{} {}'.format(math.gcd(a, b), lcm(a, b)))
    except:
        break

Python: import math
while True:
  try:
    a,b =map(int,input().split())
    c =math.gcd(a,b)
    d =a*b// math.gcd(a,b)
    print(c,d)
  except:
    break

Python: def GcdLCM():
    
    for line in sys.stdin:
        x,y=map(int,line.split())
        if x==None:
            break
        
        gcd = Gcd(x,y)
        lcm = int(x*y/gcd)

        print("{} {}".format(gcd,lcm))
       
def Gcd(x,y):
    while x!=0:
        x,y=y%x,x
    return y
        
    
GcdLCM()

Python: while True:
    try:
        spam=map(int, input().split(' '))
        spam = [i for i in spam]
        spam.sort()
        cola = spam[0] * spam[1]
        while True:
            if spam[0] == 0:
                print('{} {}'.format(spam[1],int(cola/spam[1])))
                break
            pre = spam[0]
            spam[0] = spam[1] % spam[0]
            spam[1] = pre
    except:
        break

Python: import math
while 1:
    try:
        a,b = map(int, input().split())
        print(math.gcd(a,b), int(a*b/math.gcd(a,b)))
    except:
        break

Python: # This program computes GCD and LCM
# -*- coding: utf-8
import sys


def gcd(a, b):
    while True:
        tmpb = b
        b = a % b
        a = tmpb
        if(b == 0):
            break
    return int(a)


def lcm(a, b):
    for i in range(max([a, b]), a*b + 1):
        if(i % a == 0 and i % b == 0):
            return i
    return a*b


for i in sys.stdin:
    try:
        line = [int(k) for k in i.split(" ")]
        g = gcd(max(line), min(line))
        print(str(g) + " " + str(line[0]*line[1]/g))  # + str(lcm(line[0], line[1]))
    except:
        raise
        exit()

Python: import sys
def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b)

r=[list(map(int,line.split())) for line in sys.stdin]
for i in r:
    o=gcd(i[0],i[1])
    p=i[0]*i[1]/o
    print(o,int(p))

Python: def gcd(a,b):
    if a > b:
        x = a
        y = b
    else:
        x = b
        y = a
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

def lcm(a,b,c):
    return int(a*b/c)

while 1:
    try:
        a,b = [int(x) for x in input().split()]
        res_gcd = gcd(a,b)
        res_lcm = lcm(a,b,res_gcd)
        print('{} {}'.format(res_gcd,res_lcm))
    except:
        break

Python: def gcd(a,b):
 if b==0:
  return a
 return gcd(b,a%b)

while True:
 try:
  a,b=[int(i) for i in input().split()]
 except EOFError:
  break

Python: import fractions
while 1:
    try:
        a,b=map(int,input().split())
        c=fractions.gcd(a,b)
        print(c,(a*b)//c)
    except:break

Python: try:
    GCD = 0
    LCM = 0
    while True:
        lists = list(map(int, input().split()))
        l = sorted(lists)
        num = l[0] * l[1]
        while l[0] < l[1]:
            GCD = l[1] - l[0]
            l[1] = GCD
            l = sorted(l)
            LCM = int(num / GCD)
        print(str(GCD) + " " + str(LCM))
 
        
except EOFError:
    pass

Python: import sys

def gcd(x, y):
    return gcd(y, y - x) if x != y else x

for i in sys.stdin:
    a, b = sorted(list(map(int, i.split())))
    g = gcd(a, b)
    print(g, (a*b)//g)

Python: import sys
import fractions

def main():

    dataset = sys.stdin.readlines()
    for data in dataset:
        a, b = map(int, data.split())
        gcd_num = fractions.gcd(a, b)
        print('%d %d' % (gcd_num, a * b / gcd_num))
        
    
main()

Python: # AOJ 0005 GCD and LCM
# Python3 2018.6.9 bal4u

def lcm(a, b):
	return a/gcd(a, b)*b

def gcd(a, b):
	while b != 0:
		r = a % b
		a = b
		b = r
	return a

while True:
    try:
        a = list(map(int, input().split()))
        print(gcd(a[0], a[1]), lcm(a[0], a[1]))
    except EOFError:
        break

Python: import sys
for i in sys.stdin:
    a, b = map(int, i.split())
    p, q = max(a, b), min(a, b)
    while p % q != 0:
        p, q = q, p % q
    print("{} {}".format(q, int(a * b / q)))

Python: import sys
def main():
    tmp = sys.stdin.readline().split(" ")
    print ("Hello World")
 
if __name__ == "__main__":
    main()

Python: while True:
    try:
        n=input().split()
    except:
        break
    num=[int(n[i]) for i in range(len(n))]
    max=1
    num=sorted(num)
    for i in range(1,num[0]+1):
        if num[0]%i==0:
            if num[1]%i==0:
                max=i
    print(max,int(num[0]*num[1]/max))

Python: def euclidean_algorithm(a,b):
  if a == b: return(a)
  if a >  b: return(euclidean_algorithm(a-b,b))
  if a  < b: return(euclidean_algorithm(b-a,a))
  return 0

inputs=[]
while True:
  try:
    inputs.append( list( map(int,input().split()) ) )
  except EOFError:
    break

for i in inputs:
  gcd = euclidean_algorithm(i[0],i[1])
  lcm = int(i[0]*i[1]/gcd)
  print("{0} {1}".format(gcd,lcm))

Python: import math,sys
for e in sys.stdin:
 a,b=list(map(int,e.split()));g=math.gcd(a,b)
 print(g,a*b//g)

Python: import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    c = a * b
    while b:
        a, b = b, a % b
    print(str(a) + ' ' + str(c / a))

Python: import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    c = a * b
    while b:
        a, b = b, a % b
    print(str(a) + ' ' + str(c / a))

Python: import math
while True:
    try:
        a,b=list(map(int,input().split()))
        print(math.gcd(a,b),a*b//math.gcd(a,b))
    except:break

Python: import sys
sys.setrecursionlimit(10**7)
import fileinput

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


for line in sys.stdin:
    x, y = map(int, line.split())
    print(gcd(x,y),lcm(x,y))

Python: import math

try:
 while 1:
  a,b=map(int,input().split())
  print(math.gcd(a,b),a*b// math.gcd(a, b))
except EOFError:
   pass

Python: import sys
def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b)

r=[map(int,line.split()) for line in sys.stdin]
for i in r:
    o=gcd(i[0],i[i])
    p=i[0]*i[1]/o
    print(o,p)

Python: from fractions import gcd

while True:
  try:
    a, b = map(int, input().split())
    left = gcd(a,b)
    print( left, a*b//(left))
  except:
    break

Python: def gcd(li):
    a=max(li)
    b=min(li)
    while b>0:
        a,b=b,a%b
    return a

def lcm(li):
    return li[0]*li[1]/gcd(li)

while True:
    li=[int(i) for i in input().split(" ")]
    print("%i %i"%(gcd(li),lcm(li)))

Python: import sys

def gcd(x, y):
    return gcd(y, y - x) if x != y else x

for i in sys.stdin:
    a, b = sorted(list(map(int, i.split())))
    g = gcd(a, b)
    print(g, int((a*b)/g))

Python: import sys
import math

for line in sys.stdin:
    a, b = map(int, line.split(' '))
    gcd = math.gcd(a, b)
    print(gcd, a * b // gcd)

Python: import sys
#from me.io import dup_file_stdin

def gcd(x,y):
    t = x % y
    if(t==0):
        return y
    else:
        return gcd(y, t)

#@dup_file_stdin
def solve():
    for line in sys.stdin:
        x,y = map(int,line.split(" "))
        f = gcd(x,y)
        print("{} {}".format(f, x//f*y))
 
solve()

Python: import sys
a=[map(int,i.split())for i in sys.stdin]
for i,j in a:
	c,d=i,j
	while d:
		if c > d:c,d = d,c
		d%=c
	print(c,i//c*j)