# -*-coding:utf-8

import fileinput

def main():
    for line in fileinput.input():
        tokens = list(map(int, line.strip().split()))
        a, b = tokens[0], tokens[1]

        if a < b:
            a, b = b, a

        ansGCD = GreatestCommonDivisor(a, b)
        ansLCM = LeastCommonMultiple(a, b)

        print('{0} {1}'.format(ansGCD, ansLCM))

def GreatestCommonDivisor(a, b):
    while b:
        a, b = b, a%b

    return a

def LeastCommonMultiple(a, b):
    return (a*b) / GreatestCommonDivisor(a, b)


if __name__ == '__main__':
    main() import fileinput fileinput def main():
    for line in fileinput.input():
        tokens = list(map(int, line.strip().split()))
        a, b = tokens[0], tokens[1]

        if a < b:
            a, b = b, a

        ansGCD = GreatestCommonDivisor(a, b)
        ansLCM = LeastCommonMultiple(a, b)

        print('{0} {1}'.format(ansGCD, ansLCM)) main for line in fileinput.input():
        tokens = list(map(int, line.strip().split()))
        a, b = tokens[0], tokens[1]

        if a < b:
            a, b = b, a

        ansGCD = GreatestCommonDivisor(a, b)
        ansLCM = LeastCommonMultiple(a, b)

        print('{0} {1}'.format(ansGCD, ansLCM)) line fileinput.input() fileinput.input fileinput input tokens = list(map(int, line.strip().split())) tokens list(map(int, line.strip().split())) list map(int, line.strip().split()) map int line.strip().split() line.strip().split line.strip() line.strip line strip split a, b = tokens[0], tokens[1] a tokens[0] tokens 0 b tokens[1] tokens 1 if a < b:
            a, b = b, a

         a < b a b a, b = b, a a b b a ansGCD = GreatestCommonDivisor(a, b) ansGCD GreatestCommonDivisor(a, b) GreatestCommonDivisor a b ansLCM = LeastCommonMultiple(a, b) ansLCM LeastCommonMultiple(a, b) LeastCommonMultiple a b print('{0} {1}'.format(ansGCD, ansLCM)) print '{0} {1}'.format(ansGCD, ansLCM) '{0} {1}'.format '{0} {1}' format ansGCD ansLCM def GreatestCommonDivisor(a, b):
    while b:
        a, b = b, a%b

    return a GreatestCommonDivisor while b:
        a, b = b, a%b

     b a, b = b, a%b a b b a%b a b return a a a a b b def LeastCommonMultiple(a, b):
    return (a*b) / GreatestCommonDivisor(a, b) LeastCommonMultiple return (a*b) / GreatestCommonDivisor(a, b) (a*b) / GreatestCommonDivisor(a, b) a*b a b GreatestCommonDivisor(a, b) GreatestCommonDivisor a b a a b b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    for line in fileinput.input():
        tokens = list(map(int, line.strip().split()))
        a, b = tokens[0], tokens[1]

        if a < b:
            a, b = b, a

        ansGCD = GreatestCommonDivisor(a, b)
        ansLCM = LeastCommonMultiple(a, b)

        print('{0} {1}'.format(ansGCD, ansLCM)) def main():
    for line in fileinput.input():
        tokens = list(map(int, line.strip().split()))
        a, b = tokens[0], tokens[1]

        if a < b:
            a, b = b, a

        ansGCD = GreatestCommonDivisor(a, b)
        ansLCM = LeastCommonMultiple(a, b)

        print('{0} {1}'.format(ansGCD, ansLCM)) main def LeastCommonMultiple(a, b):
    return (a*b) / GreatestCommonDivisor(a, b) def LeastCommonMultiple(a, b):
    return (a*b) / GreatestCommonDivisor(a, b) LeastCommonMultiple def GreatestCommonDivisor(a, b):
    while b:
        a, b = b, a%b

    return a def GreatestCommonDivisor(a, b):
    while b:
        a, b = b, a%b

    return a GreatestCommonDivisor
# -*-coding:utf-8

import fileinput

def main():
    for line in fileinput.input():
        tokens = list(map(int, line.strip().split()))
        a, b = tokens[0], tokens[1]

        if a < b:
            a, b = b, a

        ansGCD = GreatestCommonDivisor(a, b)
        ansLCM = LeastCommonMultiple(a, b)

        print('{0} {1}'.format(ansGCD, ansLCM))

def GreatestCommonDivisor(a, b):
    while b:
        a, b = b, a%b

    return a

def LeastCommonMultiple(a, b):
    return (a*b) / GreatestCommonDivisor(a, b)


if __name__ == '__main__':
    main()