Go: package main
import (
	"os"
	"fmt"
	"strconv"
	"bufio"
	"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: import sys
import math
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        output1 = math.gcd(a, b)
        output2 = int(a * b / output1)
        print(output1, output2)


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: # -*- coding:utf-8 -*-

import sys

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

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

array = []
for i in sys.stdin:
    array.append(i)

for i in range(len(array)):
    n, m = array[i].split()
    n, m = int(n), int(m)
    print(int(gcd(n, m)),int(lcm(n, m)))

Python: while True:
    try:
        As,Bs = map(int,input().split())
        a,b = As, Bs
        while True:
            if a % b == 0:
                gcd = b
                break
            a,b = b, a % b
        print(gcd,int(As * Bs / gcd))
    except EOFError:
        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


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

Python: def get_divisor(num):
    divisor_list = []
    for i in range(1, int(num/2)):
        divisor = num / i

        if divisor.is_integer():
            divisor_list.append(i)
            divisor_list.append(int(divisor))
    return list(set(divisor_list))

while True:
    ab = [int(str_) for str_ in input().split()]

    a_list = get_divisor(ab[0])
    b_list = get_divisor(ab[1])

    matched_list = [b for b in b_list if b in a_list]
    g = max(matched_list)
    l = int(ab[0]*ab[1] / g)
    print("{} {}".format(g, l))

Python: import sys

def dividend(num, Q):
    a = Q
    b = (num / Q) * Q
    Q = num - (num / Q) * Q
    if num  == b:
        aaa(a)
        return
    dividend(num, Q)
    
def aaa(greatest_common_divisor):
    least_common_multiple = num1 * num2 / greatest_common_divisor
    print('%s %s' % (greatest_common_divisor, least_common_multiple))
    return

for input_line in sys.stdin:
    num1 = int(input_line.split(' ')[0])
    num2 = int(input_line.split(' ')[1])
    
    if num1 <= num2:
        dividend(num2, num1)
    elif num1 > num2:
        dividend(num1, num2)

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