while True:
    try:
        a,b=map(int,input().split())
        y=a*b
        if b>a:
            a,b=b,a
        
        while a%b:
            x=a
            a,b=b,x%b

        print(b,int(y/b))

    except:
        break while True:
    try:
        a,b=map(int,input().split())
        y=a*b
        if b>a:
            a,b=b,a
        
        while a%b:
            x=a
            a,b=b,x%b

        print(b,int(y/b))

    except:
        break True try:
        a,b=map(int,input().split())
        y=a*b
        if b>a:
            a,b=b,a
        
        while a%b:
            x=a
            a,b=b,x%b

        print(b,int(y/b))

    except:
        break except:
        break break a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b y=a*b y a*b a b if b>a:
            a,b=b,a
        
         b>a b a a,b=b,a a b b a while a%b:
            x=a
            a,b=b,x%b

         a%b a b x=a x a a,b=b,x%b a b b x%b x b print(b,int(y/b)) print b int(y/b) int y/b y b y=a*b a*b y a,b=b,x%b b a b=b,x%b x%b b x=a a x b=map(int,input().split()) map(int,input().split()) b a,b=map(int,input().split()) map(int,input().split()) a b=b,a a b a,b=b,a b a
while True:
    try:
        a,b=map(int,input().split())
        y=a*b
        if b>a:
            a,b=b,a
        
        while a%b:
            x=a
            a,b=b,x%b

        print(b,int(y/b))

    except:
        break