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: import sys
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        if a > b:
            a,b = b,a
        p = a * b #product

        while True:
            hoge = a
            a = b % a
            b = hoge
            if a == 0:
                gcd = b
                break

        lcm = p // gcd
        print(gcd, lcm)




if __name__ == "__main__":
    main()

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: import sys
for i in sys.stdin:
    m, n = map(int, i.split())
    t1, t2 = m, n
    while True:
        if m % n == 0:
            break
        m, n = n, m % n
    a = n
    b = (t1/ a) * t2
    print("{} {}".format(a, b))

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


def gcd(a, b):
    while b:
        a, b = b, a % b
    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(min(line), max(line))
        print(str(g) + " " + str(line[0]*line[1]//g))  # + str(lcm(line[0], line[1]))
    except:
        exit()

Python: # -*- coding: utf-8 -*-
while True:
    try:
        list = [int(x) for x in raw_input().split(" ")]
        list.sort(lambda x, y: y - x)
        gcd = lcm = 0
        m = list[0]
        n = list[1]
        while True:
            r = m%n
            if r == 0:
                gcd = n
                break
            m = n
            n = r
        lcm = list[0] * list[1] / gcd
        print(str(gcd) + " " + str(lcm))
    except EOFError:
        break

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:
        break

Python: while True:
    try:
        a, b = [int(x) for x in input().split()]
        n, m = [min(a, b), max(a, b)]
        while n != 0:
            n, m = m % n, n
        print(m, a * b // m)
    except EOFError:
        break

Python: ###
### atcorder test program
###

import sys

### math class
class math:
    ### pi
    pi = 3.14159265358979323846264338

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

math = math()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#A, B, C = [x for x in input().split()]
#inlist = [int(w) for w in input().split()]
#R = float(input())
#A = [int(x) for x in input().split()]
#for line in sys.stdin.readlines():
#    a, b = map(int, line.split())

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

for line in sys.stdin.readlines():
    x, y = [int(temp) for temp in line.split()]
    print("{} {}".format(math.gcd(x,y), math.lcm(x,y)))

Python: while True:
    try:
        lst = list(map(int, input().split()))
        a, b = lst[0], lst[1]
        while b != 0:
            a, b = b, a % b
            
        c = lst[0]* lst[1]/ a
        print('{:.0f}'.format(a), end = " ")
        print('{:.0f}'.format(c))

    except:
        break

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

while 1:
    a, b = map(int,input().split())
    g = gcd(a, b)
    l = a / g * b
    print(g, l)

Python: t = 0
while t == 0:	
	try:
		x,y=[int(i) for i in input().split()]
	except:
		break
	else:
		a = x * y
		if x < y:
			x,y =y,x
		while y > 0:
			r = x % y
			x = y
			y = r
	print(str(x) + " " + str(int(a / x)))

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

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

if __name__ == "__main__":
    while True:
        try:
            a, b = map(int, input().split())
            g = gcd(a, b)
            l = lcm(a, b)
            print("{} {}".format(g, l))
        except:
            break

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


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


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

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

Python: #!/usr/bin/env python3
import sys
from fractions import gcd

for line in sys.stdin:
    [a, b] = [int(x) for x in line.split()]
    print(int(gcd(a, b)), int(a / gcd(a, b) * b))

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

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

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

        

        tmp = sys.stdin.readline()
        break

        
if __name__ == "__main__":
    main()

Python: import sys

def get_gcd(a, b):
    if a < b:
        a, b = b, a

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

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

def main():
    while True:
        data = sys.stdin.readline().strip()
        if data is None or data == '':
            break

        nums = data.split(' ')
        a = int(nums[0])
        b = int(nums[1])
        gcd = get_gcd(a, b)
        lcm = get_lcm(a, b, gcd)
        print(gcd, lcm)
        
        
if __name__ == '__main__':
    main()