import sys

def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
    
def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd)

sets = sys.stdin.readlines()
for line in sets:
    a, b = map(int, line.split())
    c = gcd(a, b)
    print(c, lcm(a, b, c)) import sys sys def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
     gcd large = max(inta, intb) large max(inta, intb) max inta intb small = min(inta,intb) small min(inta,intb) min inta intb mod = large % small mod large % small large small if mod ==0:
        return small
    else:
        return gcd(small, mod) 
     mod ==0 mod 0 return small small return gcd(small, mod) gcd(small, mod) gcd small mod inta inta intb intb def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd) lcm return (inta * intb // intgcd) inta * intb // intgcd inta * intb inta intb intgcd inta inta intb intb intgcd intgcd sets = sys.stdin.readlines() sets sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for line in sets:
    a, b = map(int, line.split())
    c = gcd(a, b)
    print(c, lcm(a, b, c)) line sets a, b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b c = gcd(a, b) c gcd(a, b) gcd a b print(c, lcm(a, b, c)) print c lcm(a, b, c) lcm a b c def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd) def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd) lcm def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
     def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
     gcd sets = sys.stdin.readlines() sys.stdin.readlines() sets a, b = map(int, line.split()) map(int, line.split()) a b = map(int, line.split()) map(int, line.split()) b c = gcd(a, b) gcd(a, b) c
import sys

def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
    
def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd)

sets = sys.stdin.readlines()
for line in sets:
    a, b = map(int, line.split())
    c = gcd(a, b)
    print(c, lcm(a, b, c))