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

while 1:
    try:
        n, m = map(int, input().split())
        g = gcd(n, m)
        print(g, int(n*m/g))
    except EOFError:
        break def gcd(n, m):
    while n:
        n, m = m % n, n
    return m gcd while n:
        n, m = m % n, n
     n n, m = m % n, n n m % n m n m n return m m n n m m while 1:
    try:
        n, m = map(int, input().split())
        g = gcd(n, m)
        print(g, int(n*m/g))
    except EOFError:
        break 1 try:
        n, m = map(int, input().split())
        g = gcd(n, m)
        print(g, int(n*m/g))
    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 g = gcd(n, m) g gcd(n, m) gcd n m print(g, int(n*m/g)) print g int(n*m/g) int n*m/g n*m n m g def gcd(n, m):
    while n:
        n, m = m % n, n
    return m def gcd(n, m):
    while n:
        n, m = m % n, n
    return m gcd n, m = map(int, input().split()) map(int, input().split()) n g = gcd(n, m) gcd(n, m) g m = map(int, input().split()) map(int, input().split()) m
def gcd(n, m):
    while n:
        n, m = m % n, n
    return m

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