Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		row := strings.Fields(scanner.Text())
		nums := []int{}

		for _, v := range row {
			num, _ := strconv.Atoi(v)
			nums = append(nums, num)
		}
		fmt.Println(gcd(nums[0], nums[1]), lcm(nums[0], nums[1]))
	}
}

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


    #??¬?´???°?????????
    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 = int((a * b)/max_common_div)

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

Python: def gcd(x,y):
    return gcd(y,x % y) if y > 0 else x

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

while(1):
    try:
        x,y = (int(x) for x in input().split())
        print(gcd(x,y),lcm(x,y))
    except:
        break

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

while(True):
	try:
		a,b=map(int,input().split(" "))
	except:
		break
	if(a<b):
		a,b=b,a
	GCD=GCD_cal(a,b)
	LCM=int(a*b/GCD)
	print("{0} {1}".format(GCD,LCM))

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

Python: #!/usr/bin/env python3

while(True):
	try:
		a,b=map(int, input().split())
	except EOFError:
		break
	gcd=1
	for i in range(1, a):
		if(a%i==0 and b%i==0):
			gcd=i
	lcm=int(a*b/gcd)
	print("{0} {1}".format(gcd, lcm))

Python: 
while True:
  try:
    m,n = map(int,input().split())
    if m<n:
        a = n
        b = m
    else:
        a = m
        b = n

    c = a % b
    while c != 0:
        temp = c
        if b % c == 0:
            break
        c = b % c
        b = temp

    d = m * n / c

    print(str(c) + " " + str(int(d)))

  except EOFError:
    break

Python: import sys
import math
def gcd(x,y):
    if(x%y==0):
        return y
    else:
        return(gcd(y,x%y))
try:
    while True:
        a,b= map(int, input().split())
        max1=gcd(a,b)
        min1=(a*b)//gcd(a,b)
        print(str(max1)+' '+str(min1))
except EOFError:
    pass

Python: while True:
    try:
        a, b = map(int, input().split(" "))
        if a < b:
            key = a
            a = b
            b = key
        A = a
        B = b
        while a % b != 0:
            key = a % b
            a = b
            b = key
        key = int(A * B / b)
        print(b, key)
    except:
        break

Python: k = list(map(int, input().split()))

a = k[0]
b = k[1]

r = a % b
while r != 0:
    a = b
    b = r
    r = a % b
else:
    ans1 = b


a = k[0]
b = k[1]

v = a % b
index = 2
while v != 0:
    aa = a * index
    v = aa % b
    index = index + 1
else:
    ans2 = aa

print(ans1, ans2)

Python: #coding:utf-8

while True:
    try:
        a, b = map(int, raw_input(). split())
        x = a * b
        while True:
            c = a % b
            a = b
            b = c
            if b == 0:
                break
        x = x / a
        print("%d %d" % (a, x))
    except:
        break

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: 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: # 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(int(line[0]*line[1]//g)))  # + str(lcm(line[0], line[1]))
    except:
        raise
        exit()

Python: while True:
    try:
        a,b = map(int, input().split())
        nlist = sorted([a,b])
        while True:
            c = nlist[1]%nlist[0]
            nlist = [c, nlist[0]]
            if (c == 0):
                break
        ss = nlist[1]
        print(ss, int(a*b/ss))
    
    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: import sys
from fractions import gcd
[print("{} {}".format(gcd(*x), x[0] * x[1] // gcd(*x))) for x in [list(map(int, x.split())) for x in sys.stdin]]

Python: # -*- coding: utf-8 -*-
import math
errerN=1

while errerN:
    try:
        a=list(map(int, input().split()))
        gcdN=math.gcd(a[0],a[1])
        print(gcdN, int(a[0]*a[1]/gcdN))
    except :
        errerN=0

Python: import sys

def gcd(m, n):
    r = m % n
    if r == 0:
        return n
    else:
        return gcd(n, r)

lines = sys.stdin.readlines()
for line in lines:
    a, b = map(int, line.split())
    m = max(a, b)
    n = min(a, b)
    print(gcd(m, n), m * n // gcd(m, n))

Python: import sys, math
[[print("{} {}".format(math.gcd(t[0], t[1]), t[0] * t[1] // math.gcd(t[0], t[1]))) for t in [[int(y) for y in x.split()]]] for x in sys.stdin]

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

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

Python: import math

while True:
    try:
        a, b = [int(i) for i in input().split()]

        gcd = math.gcd(a, b)
        lcm = a * b // gcd

        print(f'{gcd} {lcm}')
    except EOFError:
        break

Python: 
import sys
def lcm(x, y):
  if x > y:
      greater = x
  else:
      greater = y

  while(True):
      if((greater % x == 0) and (greater % y == 0)):
          lcm = greater
          break
      greater += 1

  return lcm
def gcd(x, y):
  while(y):
      x = y
      y = x%y
  return x
for line in sys.stdin.readlines():
  num1,num2 = map(int,line.split())
  print(lcm(num1,num2),gcd(num1,num2))

Python: import sys

def gcd(a, b):
    "?????§??¬?´???°????±???????"
    if a < b:
        c = a
        a = b
        b = c
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

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

for line in sys.stdin:
    a, b = map(int, line.split())
    print("%d %d" % (gcd(a, b), lcm(a, b)))

Python: A , B = map(int,input().split())
a , b = A , B
while a != b:
        if a < b:
                b = b-a
        elif b < a:
                a = a-b
b = int(A*B/a)
print(a,b)