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

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

while True:
    try:
        a,b=map(int,input().split())
    except:
        break
    print(gcd(a,b),lcm(a,b)) def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b) gcd if b==0:
        return a
     b==0 b 0 return a a return gcd(b,a%b) gcd(b,a%b) gcd b a%b a b a a b b def lcm(a,b):
    return (a*b)//gcd(a,b) lcm return (a*b)//gcd(a,b) (a*b)//gcd(a,b) a*b a b gcd(a,b) gcd a b a a b b while True:
    try:
        a,b=map(int,input().split())
    except:
        break
    print(gcd(a,b),lcm(a,b)) True try:
        a,b=map(int,input().split())
    except:
        break
     except:
        break
     break a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b print(gcd(a,b),lcm(a,b)) print gcd(a,b) gcd a b lcm(a,b) lcm a b def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b) def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b) gcd a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b def lcm(a,b):
    return (a*b)//gcd(a,b) def lcm(a,b):
    return (a*b)//gcd(a,b) lcm
def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

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

while True:
    try:
        a,b=map(int,input().split())
    except:
        break
    print(gcd(a,b),lcm(a,b))
