Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanLines)
	defer out.Flush()

	for sc.Scan() {
		a, b := nextInts()
		x, y := gcd(a, b), lcm(a, b)
		fmt.Fprintf(out, "%d %d\n", x, y)
	}

}

func nextInts() (a, b int) {
	s := strings.Split(sc.Text(), " ")
	ra, _ := strconv.Atoi(s[0])
	rb, _ := strconv.Atoi(s[1])
	a = ra
	b = rb
	return
}

func gcd(x, y int) int {
	if x < y {
		gcd(y, x)
	}
	for 0 < y {
		r := x % y
		x, y = y, r
	}
	return x
}

func lcm(x, y int) int {
	return (x * y) / gcd(x, y)
}

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


while True:
    try:
        nums = list(map(int, input().split()))
        print(gcd(nums[0], nums[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 True:
        if p % q == 0:
            break
        else:
            p, q = q, p % q
    print("{} {}".format(q, int(a * b / q)))

Python: import sys

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

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

def run():
    data = []
    for n in sys.stdin:
        a, b = list(map(int, n.split()))
        data.append((a,b))

    for _data in data:
        a, b = _data
        g = gcd(a,b)
        l = lcm(a,b,g)
        print(g, l)

if __name__ == '__main__':
    run()

Python: while True:
  try:
    m,n = map(int, input().split())
  except EOFError:
    break
  LCM = m * n
  if m < n:
    m,n = n,m

  # calculating GCD
  while True:
    if m % n == 0:
      GCD = n
      break
    else:
      m, n = n, m % n

  # calculating LCM
  LCM = LCM // GCD

  print(GCD,LCM)

Python: import sys

# 最大公約数(greatest common divisor)を求める関数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# 最小公倍数(least common multiple)を求める関数
# //は切り捨て除算
def lcm(a, b):
    return a * b // gcd(a, b)

lines = sys.stdin.readlines()
for line in lines:
    a = list(map(int, line.split(" ")))
    print(gcd(a[0], a[1]), lcm(a[0], a[1]))

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

Python: import sys
 
nums = []
 
 
for line in sys.stdin:
    nums.append(line)
 
for i in range(len(nums)):
    input_line = nums[i].split(" ")
    a = int(input_line[0])
    b = int(input_line[1])
 
    if a > b:
        num_bigger = a
        num_smaller = b
    else:
        num_bigger = b
        num_smaller = a

    r = 1   #?????????
    while r > 0:
        r = num_bigger % num_smaller
        num_bigger = num_smaller
        num_smaller = r

    max_common_div = num_bigger
    min_common_mpl = int((a * b)/max_common_div)
 
    print(str(max_common_div) + " " + str(min_common_mpl))

Python: def get_input():
    while True:
        try:
            yield "".join(input())
        
        except EOFError:
            break
            
def calcGCD(a,b):#?????§??¬?´???°????±?????????????????????????????????????????????¨?????????
    if a>b:
        large = a
        small = b
    elif a<b:
        large = b
        small = a
    else:
        return a
        
    
    while True:
        
        if large == small:
            return large
        
        temp_small = large - small
        
        if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small

def calcLCM(a,b,gcd):#????°???¬?????°????±??????????
    lcm = a*b/gcd
    
    return lcm
    


if __name__  == "__main__":
    array = list(get_input())
    for i in range(len(array)):
    
        temp_a,temp_b = array[i].split()
    
        a,b = int(temp_a),int(temp_b)
    
        gcd = calcGCD(a,b)
        lcm = calcLCM(a,b,gcd)
        lcm = int(lcm)
        
        print("{} {}".format(gcd,lcm))

Python: def f(x, y):
    if x % y == 0:
        return y
    return f(y, x % y)
a = []
while True:
    try:
        a.append(list(map(int, input().split())))
    except EOFError:
        break
for i in a:
    g = f(i[0], i[1])
    l = (i[0] * i[1]) / g
    print(g, int(l))

Python: import math

while True:
	try:
		a,b=list(map(int,input().split()))
		x=math.gcd(a,b)
		y=int(a*b/x)
		print("%d %d"%(x,y))
	except:
		break

Python: import sys

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

if __name__ == "__main__":
  for line in sys.stdin:
    a, b = [int(i) for i in line.strip().split(" ")]
    GCD = findGCD(a,b)
    LCM = a*b//GCD
    print(GCD, LCM)

Python: def gcd(a,b):
	while b: a,b=b,a%b
	return a
while True:
	try:
		a,b = map(int,input().split())
		print(gcd(a,b),a*b//gcd(a,b))
	except:
		break;

Python: def F(x, y):
    if x % y == 0:
        return y
    return F(y, x % y)
while True:
    try:
        x, y = map(int,input().split())
        print('{0} {1}'.format(F(x, y), int(x * y / F(x, y))))
    except EOFError:
        break

Python: import sys

def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
    
def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd)

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

Python: ans = []

def gcd(a, b) :
    if a % b == 0 :
        return b
    else :
        return gcd(b, a % b)
        
def lcm(a, b) :
    return a * b // gcd(a, b)

while True :
    try :
        s = input()
        a, b = map(int, s.split())  
        m_gcd, m_lcm = gcd(a, b), lcm(a, b)
        ans.append([m_gcd, m_lcm])
    except :
        for a in ans :
            print(a[0], a[1])
        break

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 math

while True:
 a,b=map(int,input().split())
 print(math.gcd(a,b),a*b//math.gcd(a,b))

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

Python: def pd(n):
    i = 2
    ans = []
    while i ** 2 <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(n)
    return ans

def gcd(a, b):
    gcd = 1
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
            gcd *= i
    return int(gcd)

def lcm(a, b):
    lcm = a
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
    for j in pd_b:
        lcm *= j
    return int(lcm)

while True:
    try:
        s = input()
        a,b = [int(i) for i in s.split(' ')]
    except:
        break
    print(gcd(a, b), lcm(a, b))

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

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

for i in input():
	a,b = map(int, i.split())
	gcd_num = gcd(a,b)
	lcm_num = lcm(a,b)
	print("{0} {1}".format(gcd_num,lcm_num))

Python: import sys
 
def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
     
def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd)
 
sets = sys.stdin.readlines()
for line in sets:
    a, b = map(int, line.split())
    c = gcd(a, b)
    print(c, lcm(a, b, c))