Go: package main

import (
  "fmt"
)

func gcd(a, b int) int {
  if b == 0 {
      return a
  }
  return gcd(b, a%b)
}

func main() {
  var a,b,c int
  for _, err := fmt.Scan(&a, &b); err == nil; _, err = fmt.Scan(&a, &b) {
    c = gcd(a,b)
    fmt.Println(c, a*b/c)
  }
}

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)

Python: # This program computes GCD and LCM
# -*- coding: utf-8
import sys


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


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:
        exit()

Python: import math

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

Python: import sys
def main():
    tmp = sys.stdin.readline().split(" ")
    print (tmp[0])
 
if __name__ == "__main__":
    main()

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

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