def main():
    while True:
        try:
            a,b=(int(x) for x in input().split())
        except:
            break
        a1=a
        b1=b
        while b!=0:
            c=a%b
            a=b
            b=c
        print(a, a1*b1//a)

main() def main():
    while True:
        try:
            a,b=(int(x) for x in input().split())
        except:
            break
        a1=a
        b1=b
        while b!=0:
            c=a%b
            a=b
            b=c
        print(a, a1*b1//a) main while True:
        try:
            a,b=(int(x) for x in input().split())
        except:
            break
        a1=a
        b1=b
        while b!=0:
            c=a%b
            a=b
            b=c
        print(a, a1*b1//a) True try:
            a,b=(int(x) for x in input().split())
        except:
            break
         except:
            break
         break int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a,b=(int(x) for x in input().split()) a (int(x) for x in input().split()) b a1=a a1 a b1=b b1 b while b!=0:
            c=a%b
            a=b
            b=c
         b!=0 b 0 c=a%b c a%b a b a=b a b b=c b c print(a, a1*b1//a) print a a1*b1//a a1*b1 a1 b1 a main() main def main():
    while True:
        try:
            a,b=(int(x) for x in input().split())
        except:
            break
        a1=a
        b1=b
        while b!=0:
            c=a%b
            a=b
            b=c
        print(a, a1*b1//a) def main():
    while True:
        try:
            a,b=(int(x) for x in input().split())
        except:
            break
        a1=a
        b1=b
        while b!=0:
            c=a%b
            a=b
            b=c
        print(a, a1*b1//a) main
def main():
    while True:
        try:
            a,b=(int(x) for x in input().split())
        except:
            break
        a1=a
        b1=b
        while b!=0:
            c=a%b
            a=b
            b=c
        print(a, a1*b1//a)

main()
