import sys;import math;print("\n".join(["{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) for x in sys.stdin for a, b in [[int(y) for y in x.split()]] ])) "{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) for x in sys.stdin for a, b in [[int(y) for y in x.split()]] for x in sys.stdin for a, b in [[int(y) for y in x.split()]] x sys.stdin sys stdin for a, b in [[int(y) for y in x.split()]] a b [[int(y) for y in x.split()]] [int(y) for y in x.split()] for a, b in [[int(y) for y in x.split()]] "{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) "{} {}".format "{} {}" format math.gcd(a,b) math.gcd math gcd a b a // math.gcd(a,b) * b a // math.gcd(a,b) a math.gcd(a,b) math.gcd math gcd a b b import sys sys import math math print("\n".join(["{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) for x in sys.stdin for a, b in [[int(y) for y in x.split()]] ])) print "\n".join(["{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) for x in sys.stdin for a, b in [[int(y) for y in x.split()]] ]) "\n".join "\n" join ["{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) for x in sys.stdin for a, b in [[int(y) for y in x.split()]] ]
import sys;import math;print("\n".join(["{} {}".format(math.gcd(a,b), a // math.gcd(a,b) * b) for x in sys.stdin for a, b in [[int(y) for y in x.split()]] ]))
