def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

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

while True:
    try:
        x,y=map(int,input().split())
    except:
        break
    print(gcd(x,y),x*y//gcd(x,y))