def get_input():
    while True:
        try:
            yield "".join(input())
        
        except EOFError:
            break
            
def calcGCD(a,b):#?????§??¬?´???°????±?????????????????????????????????????????????¨?????????
    if a>b:
        large = a
        small = b
    elif a<b:
        large = b
        small = a
    else:
        return a
        
    
    while True:
        
        if large == small:
            return large
        
        temp_small = large - small
        
        if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small

def calcLCM(a,b,gcd):#????°???¬?????°????±??????????
    lcm = a*b/gcd
    
    return lcm
    


if __name__  == "__main__":
    array = list(get_input())
    for i in range(len(array)):
    
        temp_a,temp_b = array[i].split()
    
        a,b = int(temp_a),int(temp_b)
    
        gcd = calcGCD(a,b)
        lcm = calcLCM(a,b,gcd)
        lcm = int(lcm)
        
        print("{} {}".format(gcd,lcm)) def get_input():
    while True:
        try:
            yield "".join(input())
        
        except EOFError:
            break
             get_input while True:
        try:
            yield "".join(input())
        
        except EOFError:
            break
             True try:
            yield "".join(input())
        
        except EOFError:
            break
             except EOFError:
            break
             break yield "".join(input()) "".join(input()) "".join "" join input() input def calcGCD(a,b):#?????§??¬?´???°????±?????????????????????????????????????????????¨?????????
    if a>b:
        large = a
        small = b
    elif a<b:
        large = b
        small = a
    else:
        return a
        
    
    while True:
        
        if large == small:
            return large
        
        temp_small = large - small
        
        if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small calcGCD if a>b:
        large = a
        small = b
    elif a<b:
        large = b
        small = a
    else:
        return a
        
    
     a>b a b large = a large a small = b small b elif a<b:
        large = b
        small = a
     a<b a b large = b large b small = a small a return a a while True:
        
        if large == small:
            return large
        
        temp_small = large - small
        
        if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small True if large == small:
            return large
        
         large == small large small return large large temp_small = large - small temp_small large - small large small if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small temp_small < small temp_small small large = small large small small = temp_small small temp_small large = temp_small large temp_small small = small small small a a b b def calcLCM(a,b,gcd):#????°???¬?????°????±??????????
    lcm = a*b/gcd
    
    return lcm
     calcLCM lcm = a*b/gcd lcm a*b/gcd a*b a b gcd return lcm lcm a a b b gcd gcd if __name__  == "__main__":
    array = list(get_input())
    for i in range(len(array)):
    
        temp_a,temp_b = array[i].split()
    
        a,b = int(temp_a),int(temp_b)
    
        gcd = calcGCD(a,b)
        lcm = calcLCM(a,b,gcd)
        lcm = int(lcm)
        
        print("{} {}".format(gcd,lcm)) __name__  == "__main__" __name__ "__main__" array = list(get_input()) array list(get_input()) list get_input() get_input for i in range(len(array)):
    
        temp_a,temp_b = array[i].split()
    
        a,b = int(temp_a),int(temp_b)
    
        gcd = calcGCD(a,b)
        lcm = calcLCM(a,b,gcd)
        lcm = int(lcm)
        
        print("{} {}".format(gcd,lcm)) i range(len(array)) range len(array) len array temp_a,temp_b = array[i].split() temp_a array[i].split() [i].split [i] array i split temp_b a,b = int(temp_a),int(temp_b) a int(temp_a) int temp_a b int(temp_b) int temp_b gcd = calcGCD(a,b) gcd calcGCD(a,b) calcGCD a b lcm = calcLCM(a,b,gcd) lcm calcLCM(a,b,gcd) calcLCM a b gcd lcm = int(lcm) lcm int(lcm) int lcm print("{} {}".format(gcd,lcm)) print "{} {}".format(gcd,lcm) "{} {}".format "{} {}" format gcd lcm lcm = int(lcm) int(lcm) lcm gcd = calcGCD(a,b) calcGCD(a,b) gcd def calcGCD(a,b):#?????§??¬?´???°????±?????????????????????????????????????????????¨?????????
    if a>b:
        large = a
        small = b
    elif a<b:
        large = b
        small = a
    else:
        return a
        
    
    while True:
        
        if large == small:
            return large
        
        temp_small = large - small
        
        if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small def calcGCD(a,b):#?????§??¬?´???°????±?????????????????????????????????????????????¨?????????
    if a>b:
        large = a
        small = b
    elif a<b:
        large = b
        small = a
    else:
        return a
        
    
    while True:
        
        if large == small:
            return large
        
        temp_small = large - small
        
        if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small calcGCD array = list(get_input()) list(get_input()) array temp_b = array[i].split() array[i].split() temp_b b = int(temp_a),int(temp_b) int(temp_b) b def calcLCM(a,b,gcd):#????°???¬?????°????±??????????
    lcm = a*b/gcd
    
    return lcm
     def calcLCM(a,b,gcd):#????°???¬?????°????±??????????
    lcm = a*b/gcd
    
    return lcm
     calcLCM def get_input():
    while True:
        try:
            yield "".join(input())
        
        except EOFError:
            break
             def get_input():
    while True:
        try:
            yield "".join(input())
        
        except EOFError:
            break
             get_input temp_a,temp_b = array[i].split() array[i].split() temp_a lcm = calcLCM(a,b,gcd) calcLCM(a,b,gcd) lcm a,b = int(temp_a),int(temp_b) int(temp_a) a
def get_input():
    while True:
        try:
            yield "".join(input())
        
        except EOFError:
            break
            
def calcGCD(a,b):#?????§??¬?´???°????±?????????????????????????????????????????????¨?????????
    if a>b:
        large = a
        small = b
    elif a<b:
        large = b
        small = a
    else:
        return a
        
    
    while True:
        
        if large == small:
            return large
        
        temp_small = large - small
        
        if temp_small < small:
            large = small
            small = temp_small 
        else:
            large = temp_small
            small = small

def calcLCM(a,b,gcd):#????°???¬?????°????±??????????
    lcm = a*b/gcd
    
    return lcm
    


if __name__  == "__main__":
    array = list(get_input())
    for i in range(len(array)):
    
        temp_a,temp_b = array[i].split()
    
        a,b = int(temp_a),int(temp_b)
    
        gcd = calcGCD(a,b)
        lcm = calcLCM(a,b,gcd)
        lcm = int(lcm)
        
        print("{} {}".format(gcd,lcm))