Go: package main

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

func getInputAsInt(in string) (int, int) {
	inArr := strings.Split(in, " ")
	// Atoi(s string) (i int, err error) のerrは捨てる
	val1, _ := strconv.Atoi(inArr[0])
	val2, _ := strconv.Atoi(inArr[1])
	return val1, val2
}

func euclidean(val1, val2 int) (int) {
	surp := 1
	for  {
		surp = val1 % val2
		if surp != 0 {
			val1 = val2
			val2 = surp
		} else {
			break
		}
	}
	return val2
}

func calcLCM(val1, val2, gcd int) (int) {
	return val1/gcd*val2
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	
	for scanner.Scan() {
		val1, val2 := getInputAsInt(scanner.Text())
		gcd := euclidean(val1, val2)
		lcm := calcLCM(val1, val2, gcd)
		fmt.Println(gcd, lcm)
	}
}

Python: # Aizu - 0005
def De(a):
    res = []
    tmp = 2
    while a != 1:
        while not (a % tmp):
            a = round(a / tmp)
            res.append(tmp)
        tmp += 1
    return res

while True:
    try:
        tmp = input()
        a = [int(i) for i in tmp.split(' ')]
    except:
        break
    b = De(a[1])
    a = De(a[0])
    pa, pb = 0, 0
    GCD, LCM = 1, 1
    while True:
        if pa == len(a):
            for i in range(pb, len(b)):
                LCM *= b[i]
            break;
        if pb == len(b):
            for i in range(pa, len(a)):
                LCM *= a[i]
            break;
        if a[pa] == b[pb]:
            GCD *= a[pa]
            LCM *= a[pa]
            pa += 1
            pb += 1
            continue
        if a[pa] < b[pb]:
            LCM *= a[pa]
            pa += 1
            continue
        if a[pa] > b[pb]:
            LCM *= b[pb]
            pb += 1
            continue
    print('%d %d'%(GCD, LCM))

Python: import sys


def g(a,b):
    return g(abs(a-b),a) if a%abs(a-b)!=0 else abs(a-b)
sets = sys.stdin.readlines()
for line in sets:
    a, b = map(int, line.split())
    c = g(a, b)
    print(c, a*b//c)

Python: import sys

for s in sys.stdin:
    a = list(map(int, s.split()))
    b = a[0]
    c = a[1]

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

    d = a[0] * a[1] / b
    print(int(b), int(d))

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: def gcd(a, b):
    if a == 0 or b == 0:
        return 0
    while b != 0:
        a, b = b, a%b
    return a

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

Python: import math
john=[]
while True:
    try:
        john.append(input())
    except EOFError:
        break
for i in john:
    k=list(map(int,i.split()))
    print(int(math.gcd(k[0],k[1])),int(k[0]*k[1]/math.gcd(k[0],k[1])))

Python: import math

while True:
    try:
        a, b = [int(x) for x in input().split()]
        print(math.gcd(a,b), a*b // math.gcd(a,b))
    except EOFError:
        break

Python: import math

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

Python: import sys


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


for line in sys.stdin.readlines():
    ab = [int(str_) for str_ in line.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 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))

for line in sys.stdin.readlines():
    ab = [int(str_) for str_ in line.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: #! /usr/bin/env python3

import sys

get = sys.stdin.read().split('\n')

for g in get:
	nums = list(map(int, g.split()))
	output = ''
	if (nums != []):
		# print(nums)
		[a, b] = nums
		while ((a != 0) and (b != 0)):
			larger = max([a, b])
			smaller = min([a, b])
			a = larger - smaller 
			b = smaller
		output += str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b]))
		print(output)

Python: import math
def main():
    def get_inputs():
        input_list = []
        count = 0
        try:
            while count < 50:
                input_list.append(input())
                count += 1
        except EOFError:
            return input_list

    input_list = get_inputs()
    lcm = lambda a,b: a*b / math.gcd(a,b)
    for str_num in input_list:
        tmp = str_num.split(" ")
        a,b = int(tmp[0]),int(tmp[1])
        x = math.gcd(a,b)
        y = int(lcm(a,b))
        print("{} {}".format(x,y))
    return None


if __name__ == '__main__':
    main()

Python: import fractions

lst = []
for i in range(200):
    try:
        lst.append(input())
    except EOFError:
        break

nums = [list(map(int, elem.split(' '))) for elem in lst]

# gcd 
res_gcd = [fractions.gcd(num[0], num[1]) for num in nums]

# lcm
res_lcm = [nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums))]

for (a, b) in zip(res_gcd, res_lcm):
    print('{} {}'.format(a, b))

Python: #!/usr/bin/env python3

while(True):
	try:
		a, b=map(int, input().split())
		
		gcd=0
		for i in range(a):
			if(a%i==0 and b%i==0):
				gcd=i
		lcm=a*b/gcd

		print("{0} {1}".format(gcd, lcm))

	except EOFError:
		break

Python: import math

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

Python: def GCD(a, b):
	if b > a:
		return GCD(b, a)
	elif a % b == 0:
		return b
	return GCD(b, a % b)
		
def LCM(a, b):
	return a * b / GCD(a, b)

import sys
L = sys.stdin.readlines()
for line in L:
	x, y = list(map(int, line.split()))
	print(GCD(x, y), LCM(x, y))

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

    return a


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


while True:
    try:
        x, y = map(int, input().split())
        print(gcd(x, y), lcm(x, y))
    except:
        break

Python: def GcdLCM():
    
    while 1:
        x,y=map(int,input().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: def gcd(a, b):
    if a == 0 or b == 0:
        return 0
    while b != 0:
        a, b = b, a%b
    return a

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

Python: import sys

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

for line in sys.stdin:
    a, b = sorted(list(map(int, line.split())))
    print(gcd(a, b), lcm(a, b))

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: import sys


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)


def main():
    for i in sys.stdin.readlines():
        a, b = [int(x) for x in i.split()]
        print(gcd(a, b), lcm(a, b))


if __name__ == '__main__':
    main()