import fractions

lst = []
for i in range(200):
    try:
        lst.append(input())
    except EOFError:
        break

nums = [list(map(int, elem.split(' '))) for elem in lst]

# gcd 
res_gcd = [fractions.gcd(num[0], num[1]) for num in nums]

# lcm
res_lcm = [nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums))]

for (a, b) in zip(res_gcd, res_lcm):
    print('{} {}'.format(a, b)) import fractions fractions lst = [] lst [] for i in range(200):
    try:
        lst.append(input())
    except EOFError:
        break i range(200) range 200 try:
        lst.append(input())
    except EOFError:
        break except EOFError:
        break break lst.append(input()) lst.append lst append input() input list(map(int, elem.split(' '))) for elem in lst for elem in lst elem lst for elem in lst list(map(int, elem.split(' '))) list map(int, elem.split(' ')) map int elem.split(' ') elem.split elem split ' ' nums = [list(map(int, elem.split(' '))) for elem in lst] nums [list(map(int, elem.split(' '))) for elem in lst] fractions.gcd(num[0], num[1]) for num in nums for num in nums num nums for num in nums fractions.gcd(num[0], num[1]) fractions.gcd fractions gcd num[0] num 0 num[1] num 1 res_gcd = [fractions.gcd(num[0], num[1]) for num in nums] res_gcd [fractions.gcd(num[0], num[1]) for num in nums] nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums)) for i in range(len(nums)) i range(len(nums)) range len(nums) len nums for i in range(len(nums)) nums[i][0] * nums[i][1] // res_gcd[i] nums[i][0] * nums[i][1] nums[i][0] [i] nums i 0 nums[i][1] [i] nums i 1 res_gcd[i] res_gcd i res_lcm = [nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums))] res_lcm [nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums))] for (a, b) in zip(res_gcd, res_lcm):
    print('{} {}'.format(a, b)) (a, b) a b zip(res_gcd, res_lcm) zip res_gcd res_lcm print('{} {}'.format(a, b)) print '{} {}'.format(a, b) '{} {}'.format '{} {}' format a b lst = [] [] lst res_lcm = [nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums))] [nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums))] res_lcm nums = [list(map(int, elem.split(' '))) for elem in lst] [list(map(int, elem.split(' '))) for elem in lst] nums res_gcd = [fractions.gcd(num[0], num[1]) for num in nums] [fractions.gcd(num[0], num[1]) for num in nums] res_gcd
import fractions

lst = []
for i in range(200):
    try:
        lst.append(input())
    except EOFError:
        break

nums = [list(map(int, elem.split(' '))) for elem in lst]

# gcd 
res_gcd = [fractions.gcd(num[0], num[1]) for num in nums]

# lcm
res_lcm = [nums[i][0] * nums[i][1] // res_gcd[i] for i in range(len(nums))]

for (a, b) in zip(res_gcd, res_lcm):
    print('{} {}'.format(a, b))