Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

//Min .
func Min(a, b int) int {
	switch a < b {
	case true:
		return a
	default:
		return b
	}
}

//GCDandLCM .
func GCDandLCM(i []int) (int, int) {
	a := i[0]
	b := i[1]

	for {
		if a == b {
			break
		} else {
			a, b = Min(a, b), int(math.Abs(float64(a-b)))
		}
	}

	return a, i[0] * i[1] / a
}

func main() {
	for sc.Scan() {
		i := Sliceconvtoi()
		g, l := GCDandLCM(i)
		fmt.Println(g, l)
	}

}

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

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

while True:
	try:
		a, b = map(int, input().split())
		print(int(gcd(a, b)), int(lcm(a, b)))
	except EOFError:
		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 = long(input_line[0])
    b = long(input_line[1])


    #??¬?´???°?????????
    common_div = []

    #?????§??¬?´???°
    if a < b:
        last_num = a
    else:
        last_num = b

    for j in range(1,last_num-1):
        if a%j == 0 and b%j == 0:
            #a???b???j??§???????????¨???
            common_div.append(j)
    
    max_common_div = common_div[len(common_div)-1]
    min_common_mpl = long((a * b)/max_common_div)

    print(str(max_common_div) + " " + str(min_common_mpl))

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 ) )