import sys

def get_input():
    return map(int, input().split(' '))

def gcd(i,j):
    if i > j:
        if i % j == 0:
            return j
        else:
            return gcd(j, i % j)
    else:
        if j % i == 0:
            return i
        else:
            return gcd(i, j % i)
    
def main():
    for line in sys.stdin:
        ls = list(map(int, line.split(' ')))
        g = gcd(ls[0], ls[1])
        print(g, int(ls[0]*ls[1]/g))

if __name__ == '__main__':
    main() import sys sys def get_input():
    return map(int, input().split(' ')) get_input return map(int, input().split(' ')) map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' def gcd(i,j):
    if i > j:
        if i % j == 0:
            return j
        else:
            return gcd(j, i % j)
    else:
        if j % i == 0:
            return i
        else:
            return gcd(i, j % i)
     gcd if i > j:
        if i % j == 0:
            return j
        else:
            return gcd(j, i % j)
    else:
        if j % i == 0:
            return i
        else:
            return gcd(i, j % i)
     i > j i j if i % j == 0:
            return j
        else:
            return gcd(j, i % j)
     i % j == 0 i % j i j 0 return j j return gcd(j, i % j) gcd(j, i % j) gcd j i % j i j if j % i == 0:
            return i
        else:
            return gcd(i, j % i)
     j % i == 0 j % i j i 0 return i i return gcd(i, j % i) gcd(i, j % i) gcd i j % i j i i i j j def main():
    for line in sys.stdin:
        ls = list(map(int, line.split(' ')))
        g = gcd(ls[0], ls[1])
        print(g, int(ls[0]*ls[1]/g)) main for line in sys.stdin:
        ls = list(map(int, line.split(' ')))
        g = gcd(ls[0], ls[1])
        print(g, int(ls[0]*ls[1]/g)) line sys.stdin sys stdin ls = list(map(int, line.split(' '))) ls list(map(int, line.split(' '))) list map(int, line.split(' ')) map int line.split(' ') line.split line split ' ' g = gcd(ls[0], ls[1]) g gcd(ls[0], ls[1]) gcd ls[0] ls 0 ls[1] ls 1 print(g, int(ls[0]*ls[1]/g)) print g int(ls[0]*ls[1]/g) int ls[0]*ls[1]/g ls[0]*ls[1] ls[0] ls 0 ls[1] ls 1 g if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def get_input():
    return map(int, input().split(' ')) def get_input():
    return map(int, input().split(' ')) get_input def gcd(i,j):
    if i > j:
        if i % j == 0:
            return j
        else:
            return gcd(j, i % j)
    else:
        if j % i == 0:
            return i
        else:
            return gcd(i, j % i)
     def gcd(i,j):
    if i > j:
        if i % j == 0:
            return j
        else:
            return gcd(j, i % j)
    else:
        if j % i == 0:
            return i
        else:
            return gcd(i, j % i)
     gcd def main():
    for line in sys.stdin:
        ls = list(map(int, line.split(' ')))
        g = gcd(ls[0], ls[1])
        print(g, int(ls[0]*ls[1]/g)) def main():
    for line in sys.stdin:
        ls = list(map(int, line.split(' ')))
        g = gcd(ls[0], ls[1])
        print(g, int(ls[0]*ls[1]/g)) main
import sys

def get_input():
    return map(int, input().split(' '))

def gcd(i,j):
    if i > j:
        if i % j == 0:
            return j
        else:
            return gcd(j, i % j)
    else:
        if j % i == 0:
            return i
        else:
            return gcd(i, j % i)
    
def main():
    for line in sys.stdin:
        ls = list(map(int, line.split(' ')))
        g = gcd(ls[0], ls[1])
        print(g, int(ls[0]*ls[1]/g))

if __name__ == '__main__':
    main()