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() {
		x, y := nextInts()
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		fmt.Fprintf(out, "%d %d\n", y, lcm/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
}

Python: ans=[]
while True:
    try:
        mins=0
        maxs=0
        nums=input().split()
        nums[0]=int(nums[0])
        nums[1]=int(nums[1])
        nums_copy=nums.copy()
        while True:
            if nums[0]%nums[1]==0:
                 maxs=nums[1]
                 break
            num=nums[1]
            nums[1]=nums[0]%nums[1]
            nums[0]=num
        mins=nums_copy[0]*nums_copy[1]/maxs
        ans.append(maxs)
        ans.append(mins)
    except:
        break

for i in range(len(ans)/2):
    print(ans[i*2],ans[i*2+1])

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: # This program computes GCD and LCM
# -*- coding: utf-8
import sys


def gcd(a, b):
    while True:
        tmpb = b
        b = a % b
        a = tmpb
        if(b == 1):
            break
    return a


def lcm(a, b):
    for i in range(max([a, b]), a*b + 1):
        if(i % a == 0 and i % b == 0):
            return i
    return a*b


for i in sys.stdin:
    try:
        line = [int(k) for k in i.split(" ")]
        g = gcd(line[0], line[1])
        print(str(g) + " " + str(line[0]*line[1]//g))  # + str(lcm(line[0], line[1]))
    except:
        raise
        exit()

Python: import math
import sys
for line in sys.stdin.readlines():
    a, b = list(map(int, line.split()))
    print(f'{math.gcd(a,b)} {a*b//math.gcd(a,b)}')

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 a*b/gcd

for line in stdin:
    a,b = line.split(" ")
    a = int(a)
    b = int(b)
    gcd = GCD(a,b)
    lcm = math.floor(LCM(a,b))

    print(str(gcd)+" "+str(lcm))
    print()

Python: import sys
def gcd(a,b):
    if a<b:
        t = a
        a = b
        b = t
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a

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

Python: def GCD(x, y):
  # 最大公約数
    if x < y:
        x, y = y, x
    while True:
        r = x % y
        if r == 0:
            return y
        x, y = y, r


def calc_DCD_LCM(x, y):
  # 最大公約数
    gcd = GCD(x, y)
  # 最小公倍数
    lcm = int(x*y/gcd)
    return(gcd, lcm)


while True:
    try:
        x, y = list(map(int, input().split()))
        gcd, lcm = calc_DCD_LCM(x, y)
        print('{0} {1}'.format(gcd, lcm))
    except:
        exit(0)

Python: import sys
def main():
    a = sys.stdin.readline()
    print ("Hello World")
 
if __name__ == "__main__":
    main()

Python: import sys
import fractions

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

Python: def get_gcd(_a, _b):
    if _a % _b == 0:
        return _b
    return get_gcd(_b, _a % _b)


if __name__ == '__main__':
    a, b = list(map(int, input().split()))
    gcd = get_gcd(a, b)
    lcm = a * b / gcd
    print(str(gcd) + " " + str(int(lcm)))

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

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

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

while True:
    try:
        a = list(map(int, input().split()))
        print(gcd(a[0], a[1]), lcm(a[0], a[1]))
    except EOFError:
        break

Python: def get_gcd(_a, _b):
    if _a % _b == 0:
        return _b
    return get_gcd(_b, _a % _b)


if __name__ == '__main__':
    while True:
        a, b = list(map(int, input().split()))
        gcd = get_gcd(a, b)
        lcm = a * b / gcd
        print(str(gcd) + " " + str(int(lcm)))

Python: def gcd(x,y):
    while y:
        x, y = y, x % y
    return x


def lcm(x,y):
    return x * y // gcd(x,y)


while True:
    try:
        a = list(map(int,input().split()))
        print(gcd(a[0],a[1]),lcm(a[0],a[1]))
    except:
        break

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

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

Python: import sys

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

for line in sys.stdin:
    (a,b)=line.split(" ")
    a=eval(a)
    b=eval(b)
    g=gcd(a,b)
    print("%d %d" % (g,a*b/g))

Python: import sys


def euc(n,m):
    if n == m:
        return m
    elif m == 1 or n == 1:
        return 1
    else:
        return euc(min(n,m), max(n,m)-min(n,m)*int(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 b < 1: return a
	a,b = b,a % b
	return gcd(a,b)
ss = input().split()
while ss:
	a,b = map(int,ss)
	g = gcd(a,b)
	l = int(a*b/g)
	print(g,l)
	try: ss = input().split()
	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()]]]

Python: import math, sys
def lcm(a,b):
    return int(a*b/math.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        (a,b) = map(int,line.split())
        print(math.gcd(a,b),lcm(a,b))

Python: def GCD(x, y):
    if(x == 0):
        return(y)
    return(GCD(y % x, x))

def LCM(x, y):
    return(x * y / GCD(x, y))

while(True):
    try:
        a = map(int, raw_input().split())
        if(a[0] > a[1]):
            a[0], a[1] = a[1], a[0]
        print(GCD(a[0], a[1])),
        print(LCM(a[0], a[1]))
    except Exception:
        break

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

Python: from math import gcd

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

Python: import math
import sys

while True:
	try:
		a,b = map(int, input().split())
		p = a
		q = b
		while True:
			r = p%q
			if r == 0:
				x = q
				break
			else:
				p = q
				q = r
		i = 1
		while True:
			if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		print(x,y)
	except EOFError:
		break

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

Python: import sys
def gcd(a,b):
    if a==b:
        return a
    while(b>0):
        a,b = b,a%b
        if b==0:
            return a
def lcm(a,b):
    n=1
    m=1
    while(n*a!=m*b):
        if n*a>m*b:
            m+=1
        elif n*a<m*b:
            n+=1
    return n*a
lines = sys.stdin.readlines()
for line in lines:
    line = line.split(" ")
    inp = []
    for i in line:
        inp.append(int(i))
    inp.sort()
    a = inp[0]
    b = inp[1]
    print("%d %d" % (gcd(a,b),lcm(a,b)))