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: #mathモジュールをインポートする
import math
try:
    while True:
        a,b = map(int,input().split())
        #最小公約数
        num1 = math.gcd(a,b)
        #最大公倍数
        num2 = int(a * b / num1)
        print(str(num1) + " " + str(num2))
#EOFErrorをひろいコードを終了する
except EOFError:
    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 gcd(a, b):
    for i in range(1, a+1):
        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: import sys

def gcd(x, y):
    if x % y != 0:
        return gcd(y, x % y)
    return y

for i in sys.stdin:
    x, y = map(int, i.split())
    g = gcd(x,y)
    print(g, int(x*y/g))

Python: import sys
import math
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        o1 = math.gcd(a, b)
        o2 = int(a * b / o1)
        print(o1, o2)


if __name__ == "__main__":
    main()

Python: import sys


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


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

Python: # coding=utf-8


def solve_gcd(number1: int, number2: int) -> int:
    two_list = [number1, number2]
    two_list.sort()
    if two_list[1] % two_list[0] == 0:
        return two_list[0]
    r = two_list[1] % two_list[0]
    return solve_gcd(two_list[0], r)


def solve_lcm(number1: int, number2: int, number3: int) -> int:
    return number1*number2//number3


if __name__ == '__main__':
    while True:
        try:
            a, b = map(int, input().split())
        except EOFError:
            break
        gcd = solve_gcd(a, b)
        lcm = solve_lcm(a, b, gcd)
        print(gcd, lcm)

Python: # -*- coding: utf-8 -*-

import sys
import os

def gcd(a, b):
    # big - small
    while a != b:
        if a > b:
            a, b = b, a
        a, b = b - a, a
    return a

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

lst = sys.stdin.readlines()
for s in lst:
    a, b = map(int, s.split())
    G = gcd(a, b)
    L = lcm(a, b)
    print(G, L)

Python: import sys
def main():
    tmp = sys.stdin.readline()
    while tmp:
        tmp = sys.stdin.readline().split("")
        if a > b:
            c = a
            d = b
        else:
            c = b
            d = a

        

        tmp = sys.stdin.readline()

        
if __name__ == "__main__":
    main()

Python: from math import gcd
import sys

for line in sys.stdin:
    a, b = list(map(int, line.split()))
    print("{0} {1}".format(gcd(a, b), int((a * b) / gcd(a, b))))

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


def LCM(a, b, a_b_GCD):
    return int((a * b) / a_b_GCD)

while True:
    a, b = map(int, input().split(' '))
    a, b = max(a, b), min(a, b)

    print(GCD(a, b), LCM(a, b, GCD(a, b)))

Python: a, b = map(int, input().split())
d = a * b
if a < b:
    tmp = a
    a = b
    b = tmp

c = a % b
while(c != 0):
    a = b
    b = c
    c = a % b

g = b
l = d / g

print(str(g)+" "+str(l))

Python: #!/usr/bin/env python3

while(True):
	try:
		a,b=map(int, input().split())
	except EOFError:
		break

	#euclidian algorithm	
	r=a%b
	x,y=a,b
	while(r>0):
		x=y
		y=r
		r=x%y
	gcd=y
	lcm=int(a*b/gcd)
	print("{0} {1}".format(gcd, lcm))

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

Python: def euclidean_algorithm(a,b):
  if a == b: return(a)
  if a >  b: return(euclidean_algorithm(a-b,b))
  if a  < b: return(euclidean_algorithm(b-a,a))

inputs=[]
while True:
  try:
    inputs.append( list( map(int,input().split()) ) )
  except EOFError:
    break

for i in inputs:
  gcd = euclidean_algorithm(i[0],i[1])
  lcm = int(i[0]*i[1]/gcd)
  print("{0} {1}".format(gcd,lcm))

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 // g * b
    print(g, l)

Python: import math

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

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

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


while True:
    try:
        nums = list(map(int, input().split()))
        print(gcd(nums[0], nums[1]), lcd(nums[0], nums[1]))

    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 math
while True:
    try:
        x, y = map(int, input().split())
        print(str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y)))
    except EOFError:
        break

Python: import sys

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

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

for line in sys.stdin:
	a,b = map(int, line.split())
	print("{} {}".format(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: def gcd(li):
    a=max(li)
    b=min(li)
    while b>0:
        a,b=b,a%b
    return a

def lcm(li):
    return li[0]*li[1]/gcd(li)

while True:
    try:
        li=[int(i) for i in input().split(" ")]
        print("%i %i"%(gcd(li),lcm(li)))
    except:break

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