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 sys
from fractions import gcd
[print("{} {}".format(gcd(k[0], k[1]), (k[0] * k[1]) // gcd(k[0], k[1]))) for i in sys.stdin for k in [[int(j) for j in i.split()]]]

Python: import math
import sys
if __name__ == '__main__':

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

Python: import sys

def gcd(m, n):
    if n != 0:
        return gcd(n, m % n)
    else:
        return m

for line in sys.stdin.readlines():
    m, n = map(int, line.split())
    g = gcd(m, n)
    l = m * n // g    # LCM
    print(g, l)

Python: import sys
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:
    a,b=line.split(" ")
    print(gcd(a,b),lcm(a,b))

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

Python: from sys import stdin
import math

def GCD(a,b):
    if(a%b==0):
        return b
    else:
        c = a%b
        return GCD(b,c)

def LCM(a,b):
    gcd = GCD(a,b)
    return int(a*b/gcd)

for line in stdin:
    a,b = line.split(" ")
    a = int(a)
    b = int(b)
    gcd = GCD(a,b)
    lcm = LCM(a,b)

    print(str(gcd)+" "+str(lcm))

Python: import sys
  
for m,n in [map(int,x.split()) for x in list(sys.stdin)]:
    g,r = m,n
    while r!=0:
      g,r = r,g%r
    print(g,m//g*n)

Python: import sys
def gcd(a, b):
    for i in range(1, a):
        if a % i == 0:
            t = a // i
            if b % t == 0:
                return t
for line in sys.stdin:
    a, b = sorted(map(int, line.split()))
    gcdab = gcd(a, b)
    print(gcdab, a // gcdab * b)

Python: def main():
	import sys

	for line in sys.stdin:
		a, b = map(int, line.split())
		c = a*b

		while a % b != 0:
			a, b = b, a%b

		print(b, c*b)

if __name__ == '__main__':
	main()

Python: # coding: utf-8

while True:
	try:
		data = map(int, raw_input().split())
		if data[0] > data[1]:
			a = data[0]
			b = data[1]
		else:
			a = data[1]
			b = data[0]
		
		r = 1
		while r > 0:
			q = a / b
			r = a - b * q
			a = b
			b = r
		gcd = a
		lcm = data[0] * data[1] / gcd

		print("{:} {:}".format(gcd, lcm))

	except EOFError:
		break

Python: import sys

def euc(n,m):
    if n == m:
        return m
    elif m == 1 | n == 1:
        return 1
    else:
        return euc(min(n,m), max(n,m)-min(n,m))

for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b)))

Python: import sys
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
for line in sys.stdin:
    a, b = [int(x) for x in line.split()]
    c = math.gcd(a, b)
    d = lcm(a, b)
    print("%d %d" % (c, d) )

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

Python: import math
while True:
    a,b = map(int, input().split())
    print(str(math.gcd(a, b))+" "+str(a * b // math.gcd(a, b)))

Python: import sys

def gcd(a,b):
	a,b=max(a,b),min(a,b)
	while a%b:
		a,b=b,a%b
	return b
	
def lcm(a,b):
	return a//gcd(a,b)*b
	
for i in sys.stdin:
	a,b=map(int,i.split())
	print(gcd(a,b),lcm(a,b))

Python: import sys;

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

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

Python: #! /usr/lib/python3
import fractions
while True:
    try:
        a, b=map(int, input().split())
        s=fractions.gcd(a,b)
        print("{0} {1:.0f}".format(s,a*b/s))
    except:
        break

Python: import math
import sys

while True:
	try:
		a,b = map(int, input().split())
		x = math.gcd(a,b)
		i = 1
		while True:
			if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		print(x,y)
	except EOFError:
		break

Python: 
import sys
# from fractions import gcd
from math import gcd
[print("{} {}".format(gcd(k[0], k[1]), (k[0] * k[1]) // gcd(k[0], k[1]))) for i in sys.stdin for k in [[int(j) for j in i.split()]]]

Python: def solve(a, b):
  if a % b == 0:
    return b
  else:
    return solve(b, a % b)
  
while True:
  try:
    a, b = map(int, input().split())
    lcm = solve(a,b)
    print(lcm, a * b // lcm)

  except:
    break

Python: import math
a, b = map(int, input().split())
# 最小公倍数
def lcm(a, b):
    return (a*b) // math.gcd(a ,b)
# 出力　

print("{} {}".format(math.gcd(a, b), lcm(a, b)))

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

Python: 
import sys
from fractions import gcd
[print("{} {}".format(gcd(k[0], k[1]), (k[0] * k[1]) // gcd(k[0], k[1]))) for i in sys.stdin for k in [[int(j) for j in i.split()]]]

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

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

Python: while True:
    try:
        # a >=b
        a, b = sorted(map(int, input().strip("\n").split(" ")), reverse=True)
        d = a * b

        # calc. gcm by　ユークリッド互除法
        while True:
            c = a % b
            # print("{0} {1} {2}".format(a, b, c))
            if c == 0:
                break
            else:
                a, b = sorted([b, a % b], reverse=True)
        gcm = b
        lcm = d / gcm
        # print("gcm is {}".format(b))
        print("{0:d} {1:d}".format(int(gcm), int(lcm)))

        #print("{0} {1}".format(a, b))
        #a, b = sorted([b, a % b], reverse=True)
        #print("{0} {1}".format(a, b))

    except EOFError:
        break  # escape from while loop

Python: #encoding=utf-8
import sys

printf = sys.stdout.write
ans = []
def gcd(a,b):
    if a == b:
        return a
    else:
        return gcd(b, abs(a-b))

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

if __name__ == "__main__":
    for i in sys.stdin:
        a,b = map(int, i.split())
        ans.append(gcd(a,b))
        ans.append(lcm(a,b,gcd(a,b)))
        
    for i in xrange(0,len(ans)  - 2,2):
        printf(str(ans[i]) + " " + str(ans[i + 1]) + "\n")
        
    printf(str(ans[len(ans) - 2]) + " " + str(ans[len(ans) - 1]))

Python: t = 0
while t == 0:	
	try:
		x,y=[int(i) for i in input().split()]
	except:
		break
	else:
		a = x * y
		if x < y:
			x,y =y,x
		while y > 0:
			r = x % y
			x = y
			y = r
	print(str(x) + " " + str(a / x))

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
	while True:		
		try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b))
def lcm(a, b):
	return (a * b) // gcd(a,b)
def gcd(a, b):
	while b != 0:
		a, b = b, a % b
	return a	
			
if __name__ == '__main__':
  main()

Python: while(True):
    try:
        (a, b) = map(int, input().split(" "))
        (x, y) = (a, b)
        while (x != 0):
            (x, y) = (y%x, x)
        print("%s %s" %(y, a*b//y))
    except:
        break

Python: import sys


def g(inta, intb):
    d = abs(a - b)
    return g(d, a) if a % d != 0 else d


def lcm(inta, intb, intgcd):
    return inta * intb // intgcd


for line in sys.stdin:
    a, b = map(int, line.split())
    c = g(a, b)
    print(c, lcm(a,b,c))

Python: 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