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

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

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