Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

//Min .
func Min(a, b int) int {
	switch a < b {
	case true:
		return a
	default:
		return b
	}
}

//GCDandLCM .
func GCDandLCM(i []int) (int, int) {
	a := i[0]
	b := i[1]

	for {
		if a == b {
			break
		} else {
			a, b = Min(a, b), int(math.Abs(float64(a-b)))
		}
	}

	return a, i[0] * i[1] / a
}

func main() {
	for sc.Scan() {
		i := Sliceconvtoi()
		g, l := GCDandLCM(i)
		fmt.Println(g, l)
	}

}

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

Python: import math
a, b = map(int, input().split())
# 最小公倍数
def lcm(a, b):
    return (a*b) // math.gcd(a ,b)
# 出力　
print(math.gcd(a, b))
print(lcm(a, b))

Python: import sys
def main():
    for line in iter(sys.stdin.readline, ""):
        print (line)

        
if __name__ == "__main__":
    main()

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: # -*- coding:utf-8 -*-

def gcd(a,b):
    big,small=max(a,b),min(a,b)
    while big%small!=0:
        big,small=small,big%small
    return small

def lcm(a,b):
    return int(a*b/gcd(a,b))
 
def main():
    while True:
        try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break
if __name__ == '__main__':
    main()

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

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 sys

#最大公約数
def gcd(x, y):
    s = x / y
    r = x % y
    if r == 0:
        return y
    else:
        return gcd(y, r)

#最小公倍数
def lcm(x, y):
    return x*y/gcd(x, y)

def main():
    #print ("a")
    tmp = sys.stdin.readline().split(" ")
    #print ("b")
    while 1:
        a = int(tmp[0])
        b = int(tmp[1])
        #print ("a="+str(a))
        #print ("b="+str(b))
        #b = sys.stdin.readline()
        #print ("d")
        if a > b:
            c = a
            d = b
        else:
            c = b
            d = a

        print (str(gcd(c, d)) + " " + str(int(lcm(c,d))))

        tmp = sys.stdin.readline()
        if len(tmp) == 1:
            break
        else:
            tmp = tmp.split(" ")

    #print ("exit")
     
if __name__ == "__main__":
    main()

Python: import sys

for line in sys.stdin:
    n = [int(i) for i in line.replace("\n", "").split(" ")]
    n.sort()
    low = n[0]
    hi = n[1]
    while hi % low:
        hi, low = low, hi % low
    print("%d %d" % (low, n[0] / low * n[1]))

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

Python: def GcdLCM():
    
    while 1:
        x,y=map(int,input().split())
        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: 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: 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)

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

Python: import sys 
for e in sys.stdin:
    a, b = map(int, e.split())
    p = a * b
    while b:
        a, b = b, a%b
        pass
    print (a,p//a)

Python: 
import fractions
 
while 1:
    try:
        a, b = map(int, input().split())
        c = fractions.gcd(a, b)
        print(c, a * b // c)
    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: from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
import sys
from fractions import gcd

for line in sys.stdin:
    small, large = sorted(int(n) for n in line .split())
    G = gcd(large, small)
    print(G, large // G * small)

Python: import fileinput
import math
for line in fileinput.input():
    if line == "\n":
        break
    else:
        a, b = map(int, line.split())
        g = math.gcd(a, b)
        lcm = a * b // g
        print(g, lcm)

Python: import math

while True:
    try:
        a, b = list(map(int, input().split()))
        print('{0} {1}'.format(math.gcd(a, b), int(a * b / math.gcd(a, b))))
    except EOFError:
        break

Python: while True:
    try:
        r = sorted(list(map(int, input().split())))
        
        
        def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
        def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
        print("{a} {b}".format(a=euclidfunc(r[1], r[0]), b=lcmfunc(r[1], r[0])))
    except EOFError:
        break

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

Python: import sys
def main():
    tmp = sys.stdin.readline().split(" ")
    a = long(tmp[0])
    b = long(tmp[1])
    print ("Hello World")
 
if __name__ == "__main__":
    main()

Python: while 1 == 1:
    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(int(l)))

Python: import sys
from math 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
import sys

for line in sys.stdin:
	x,y = [int(s) for s in line.split(' ')]
	G = math.gcd(x,y)
	L = int(x*y/G)
	print(G,L)

Python: import sys

temp = []
largest = 1

for line in sys.stdin:
    a,b = [int(x) for x in line.split()]
    if a > b:
        x,y = a,b
    else:
        x,y = b,a
    for i in list(reversed(range(2, x))):
        if (x % i) == 0 and (y % i) == 0:
            x = x / i
            y = y / i
            largest *= i
    smallest = largest * (a/largest) * (b/largest)
    print('%d %d' % (largest, smallest))
    largest = 1

Python: import sys

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

for line in sys.stdin:
    a,b = map(int, line.split())
    if a<b:
        tem = a
        a = b
        b = tem
    gc = gcd(a,b)
    print(gc, a*b//gc)