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

import sys

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b!=0:
        c = b
        b = a % b
        a = c
    return a

def lcm(a, b, g):
    return a * b / g

def main():
    for line in sys.stdin:
        a, b = map(int, line.split())
        ng = gcd(a, b)
        nl = lcm(a, b, ng)
        print('{0:d} {1:d}'.format(int(ng), int(nl)))

if __name__ == '__main__':
    main() import sys sys def gcd(a, b):
    if a < b:
        a, b = b, a
    while b!=0:
        c = b
        b = a % b
        a = c
    return a gcd if a < b:
        a, b = b, a
     a < b a b a, b = b, a a b b a while b!=0:
        c = b
        b = a % b
        a = c
     b!=0 b 0 c = b c b b = a % b b a % b a b a = c a c return a a a a b b def lcm(a, b, g):
    return a * b / g lcm return a * b / g a * b / g a * b a b g a a b b g g def main():
    for line in sys.stdin:
        a, b = map(int, line.split())
        ng = gcd(a, b)
        nl = lcm(a, b, ng)
        print('{0:d} {1:d}'.format(int(ng), int(nl))) main for line in sys.stdin:
        a, b = map(int, line.split())
        ng = gcd(a, b)
        nl = lcm(a, b, ng)
        print('{0:d} {1:d}'.format(int(ng), int(nl))) line sys.stdin sys stdin a, b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b ng = gcd(a, b) ng gcd(a, b) gcd a b nl = lcm(a, b, ng) nl lcm(a, b, ng) lcm a b ng print('{0:d} {1:d}'.format(int(ng), int(nl))) print '{0:d} {1:d}'.format(int(ng), int(nl)) '{0:d} {1:d}'.format '{0:d} {1:d}' format int(ng) int ng int(nl) int nl if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    for line in sys.stdin:
        a, b = map(int, line.split())
        ng = gcd(a, b)
        nl = lcm(a, b, ng)
        print('{0:d} {1:d}'.format(int(ng), int(nl))) def main():
    for line in sys.stdin:
        a, b = map(int, line.split())
        ng = gcd(a, b)
        nl = lcm(a, b, ng)
        print('{0:d} {1:d}'.format(int(ng), int(nl))) main def lcm(a, b, g):
    return a * b / g def lcm(a, b, g):
    return a * b / g lcm def gcd(a, b):
    if a < b:
        a, b = b, a
    while b!=0:
        c = b
        b = a % b
        a = c
    return a def gcd(a, b):
    if a < b:
        a, b = b, a
    while b!=0:
        c = b
        b = a % b
        a = c
    return a gcd
# -*- coding: utf-8 -*-

import sys

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b!=0:
        c = b
        b = a % b
        a = c
    return a

def lcm(a, b, g):
    return a * b / g

def main():
    for line in sys.stdin:
        a, b = map(int, line.split())
        ng = gcd(a, b)
        nl = lcm(a, b, ng)
        print('{0:d} {1:d}'.format(int(ng), int(nl)))

if __name__ == '__main__':
    main()