#! /usr/bin/env python3

import sys

get = sys.stdin.read().split('\n')

for g in get:
	nums = list(map(int, g.split()))
	output = ''
	if (nums != []):
		# print(nums)
		[a, b] = nums
		while ((a != 0) and (b != 0)):
			larger = max([a, b])
			smaller = min([a, b])
			a = larger - smaller 
			b = smaller
		output += str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b]))
		print(output) import sys sys get = sys.stdin.read().split('\n') get sys.stdin.read().split('\n') sys.stdin.read().split sys.stdin.read() sys.stdin.read sys.stdin sys stdin read split '\n' for g in get:
	nums = list(map(int, g.split()))
	output = ''
	if (nums != []):
		# print(nums)
		[a, b] = nums
		while ((a != 0) and (b != 0)):
			larger = max([a, b])
			smaller = min([a, b])
			a = larger - smaller 
			b = smaller
		output += str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b]))
		print(output) g get nums = list(map(int, g.split())) nums list(map(int, g.split())) list map(int, g.split()) map int g.split() g.split g split output = '' output '' if (nums != []):
		# print(nums)
		[a, b] = nums
		while ((a != 0) and (b != 0)):
			larger = max([a, b])
			smaller = min([a, b])
			a = larger - smaller 
			b = smaller
		output += str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b]))
		print(output) nums != [] nums [] [a, b] = nums [a, b] a b nums while ((a != 0) and (b != 0)):
			larger = max([a, b])
			smaller = min([a, b])
			a = larger - smaller 
			b = smaller
		 (a != 0) and (b != 0) a != 0 a 0 b != 0 b 0 larger = max([a, b]) larger max([a, b]) max [a, b] a b smaller = min([a, b]) smaller min([a, b]) min [a, b] a b a = larger - smaller a larger - smaller larger smaller b = smaller b smaller output += str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b])) output str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b])) str(max([a, b])) + ' ' str(max([a, b])) str max([a, b]) max [a, b] a b ' ' str((nums[0]*nums[1])//max([a,b])) str (nums[0]*nums[1])//max([a,b]) nums[0]*nums[1] nums[0] nums 0 nums[1] nums 1 max([a,b]) max [a,b] a b print(output) print output nums = list(map(int, g.split())) list(map(int, g.split())) nums get = sys.stdin.read().split('\n') sys.stdin.read().split('\n') get output += str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b])) str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b])) output output = '' '' output larger = max([a, b]) max([a, b]) larger a = larger - smaller larger - smaller a smaller = min([a, b]) min([a, b]) smaller b = smaller smaller b
#! /usr/bin/env python3

import sys

get = sys.stdin.read().split('\n')

for g in get:
	nums = list(map(int, g.split()))
	output = ''
	if (nums != []):
		# print(nums)
		[a, b] = nums
		while ((a != 0) and (b != 0)):
			larger = max([a, b])
			smaller = min([a, b])
			a = larger - smaller 
			b = smaller
		output += str(max([a, b])) + ' ' + str((nums[0]*nums[1])//max([a,b]))
		print(output)