# -*- coding:utf-8 -*-

def gcd(a,b):
    big,small=max(a,b),min(a,b)
    while big%small!=0:
        big,small=small,big%small
    return small

def lcm(a,b):
    return int(a*b/gcd(a,b))
 
def main():
    while True:
        try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break
if __name__ == '__main__':
    main() def gcd(a,b):
    big,small=max(a,b),min(a,b)
    while big%small!=0:
        big,small=small,big%small
    return small gcd big,small=max(a,b),min(a,b) big max(a,b) max a b small min(a,b) min a b while big%small!=0:
        big,small=small,big%small
     big%small!=0 big%small big small 0 big,small=small,big%small big small small big%small big small return small small a a b b def lcm(a,b):
    return int(a*b/gcd(a,b))
  lcm return int(a*b/gcd(a,b)) int(a*b/gcd(a,b)) int a*b/gcd(a,b) a*b a b gcd(a,b) gcd a b a a b b def main():
    while True:
        try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break main while True:
        try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break True try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break except:
            break break IN=input() IN input() input val=IN.split() val IN.split() IN.split IN split g=gcd(int(val[0]),int(val[1])) g gcd(int(val[0]),int(val[1])) gcd int(val[0]) int val[0] val 0 int(val[1]) int val[1] val 1 l=lcm(int(val[0]),int(val[1])) l lcm(int(val[0]),int(val[1])) lcm int(val[0]) int val[0] val 0 int(val[1]) int val[1] val 1 print(g,l) print g l if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def lcm(a,b):
    return int(a*b/gcd(a,b))
  def lcm(a,b):
    return int(a*b/gcd(a,b))
  lcm def gcd(a,b):
    big,small=max(a,b),min(a,b)
    while big%small!=0:
        big,small=small,big%small
    return small def gcd(a,b):
    big,small=max(a,b),min(a,b)
    while big%small!=0:
        big,small=small,big%small
    return small gcd def main():
    while True:
        try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break def main():
    while True:
        try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break main
# -*- coding:utf-8 -*-

def gcd(a,b):
    big,small=max(a,b),min(a,b)
    while big%small!=0:
        big,small=small,big%small
    return small

def lcm(a,b):
    return int(a*b/gcd(a,b))
 
def main():
    while True:
        try:
            IN=input()
            val=IN.split()
            g=gcd(int(val[0]),int(val[1]))
            l=lcm(int(val[0]),int(val[1]))

            print(g,l)
        except:
            break
if __name__ == '__main__':
    main()