def gcd(n, m):
    while n!=0:
        tmp = n
        n = m % n
        m = tmp
    return m

while 1:
    try:
        n, m = map(int, input().split())
        x = gcd(n, m)
        print(x, int(n*m/x))
    except EOFError:
        break def gcd(n, m):
    while n!=0:
        tmp = n
        n = m % n
        m = tmp
    return m gcd while n!=0:
        tmp = n
        n = m % n
        m = tmp
     n!=0 n 0 tmp = n tmp n n = m % n n m % n m n m = tmp m tmp return m m n n m m while 1:
    try:
        n, m = map(int, input().split())
        x = gcd(n, m)
        print(x, int(n*m/x))
    except EOFError:
        break 1 try:
        n, m = map(int, input().split())
        x = gcd(n, m)
        print(x, int(n*m/x))
    except EOFError:
        break except EOFError:
        break break n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m x = gcd(n, m) x gcd(n, m) gcd n m print(x, int(n*m/x)) print x int(n*m/x) int n*m/x n*m n m x n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m def gcd(n, m):
    while n!=0:
        tmp = n
        n = m % n
        m = tmp
    return m def gcd(n, m):
    while n!=0:
        tmp = n
        n = m % n
        m = tmp
    return m gcd x = gcd(n, m) gcd(n, m) x
def gcd(n, m):
    while n!=0:
        tmp = n
        n = m % n
        m = tmp
    return m

while 1:
    try:
        n, m = map(int, input().split())
        x = gcd(n, m)
        print(x, int(n*m/x))
    except EOFError:
        break