try:
    while True:
        x=list(sorted(map(int, input().split())))
        a=x[0]
        b=x[1]
        while b%a != 0:
            c=a
            a=b%a
            b=c
        print(a, x[0]*x[1]//a)
except EOFError:
    pass try:
    while True:
        x=list(sorted(map(int, input().split())))
        a=x[0]
        b=x[1]
        while b%a != 0:
            c=a
            a=b%a
            b=c
        print(a, x[0]*x[1]//a)
except EOFError:
    pass except EOFError:
    pass while True:
        x=list(sorted(map(int, input().split())))
        a=x[0]
        b=x[1]
        while b%a != 0:
            c=a
            a=b%a
            b=c
        print(a, x[0]*x[1]//a) True x=list(sorted(map(int, input().split()))) x list(sorted(map(int, input().split()))) list sorted(map(int, input().split())) sorted map(int, input().split()) map int input().split() ().split () input split a=x[0] a x[0] x 0 b=x[1] b x[1] x 1 while b%a != 0:
            c=a
            a=b%a
            b=c
         b%a != 0 b%a b a 0 c=a c a a=b%a a b%a b a b=c b c print(a, x[0]*x[1]//a) print a x[0]*x[1]//a x[0]*x[1] x[0] x 0 x[1] x 1 a b=c c b b=x[1] x[1] b a=x[0] x[0] a x=list(sorted(map(int, input().split()))) list(sorted(map(int, input().split()))) x a=b%a b%a a c=a a c
try:
    while True:
        x=list(sorted(map(int, input().split())))
        a=x[0]
        b=x[1]
        while b%a != 0:
            c=a
            a=b%a
            b=c
        print(a, x[0]*x[1]//a)
except EOFError:
    pass