import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        }
    }
    
    static long GCD (long a, long b){
	    long candidate = a;
	    while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    }
	    return candidate;
	}
    
    static long LCM (long a, long b){
		long GCD = GCD(a, b);
		//System.out.println("GCD("+a+","+b+") is "+GCD);
		return GCD * (a/GCD) * (b/GCD);
	}
 
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        }
    }
    
    static long GCD (long a, long b){
	    long candidate = a;
	    while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    }
	    return candidate;
	}
    
    static long LCM (long a, long b){
		long GCD = GCD(a, b);
		//System.out.println("GCD("+a+","+b+") is "+GCD);
		return GCD * (a/GCD) * (b/GCD);
	}
 
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        } true {
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        } String tmp = br.readLine(); tmp br.readLine() br.readLine br if(tmp == null){
                break;
            } tmp == null tmp null {
                break;
            } break; String[] tmpArray = tmp.split(" "); tmpArray tmp.split(" ") tmp.split tmp " " int a = Integer.parseInt(tmpArray[0]); a Integer.parseInt(tmpArray[0]) Integer.parseInt Integer tmpArray[0] tmpArray 0 int b = Integer.parseInt(tmpArray[1]); b Integer.parseInt(tmpArray[1]) Integer.parseInt Integer tmpArray[1] tmpArray 1 System.out.println(GCD(a,b) + " "+ LCM(a,b)) System.out.println System.out System System.out GCD(a,b) + " "+ LCM(a,b) GCD(a,b) + " "+ LCM(a,b) GCD(a,b) GCD a b " " LCM(a,b) LCM a b String[] args args static long GCD (long a, long b){
	    long candidate = a;
	    while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    }
	    return candidate;
	} GCD {
	    long candidate = a;
	    while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    }
	    return candidate;
	} long candidate = a; candidate a while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    } b % a != 0 b % a b a 0 {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    } candidate = b % a candidate b % a b a b = a b a a = candidate a candidate return candidate; candidate long a a long b b static long LCM (long a, long b){
		long GCD = GCD(a, b);
		//System.out.println("GCD("+a+","+b+") is "+GCD);
		return GCD * (a/GCD) * (b/GCD);
	} LCM {
		long GCD = GCD(a, b);
		//System.out.println("GCD("+a+","+b+") is "+GCD);
		return GCD * (a/GCD) * (b/GCD);
	} long GCD = GCD(a, b); GCD GCD(a, b) GCD a b return GCD * (a/GCD) * (b/GCD); GCD * (a/GCD) * (b/GCD) GCD * (a/GCD) * (b/GCD) GCD (a/GCD) a GCD (b/GCD) b GCD long a a long b b public class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        }
    }
    
    static long GCD (long a, long b){
	    long candidate = a;
	    while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    }
	    return candidate;
	}
    
    static long LCM (long a, long b){
		long GCD = GCD(a, b);
		//System.out.println("GCD("+a+","+b+") is "+GCD);
		return GCD * (a/GCD) * (b/GCD);
	}
 
} public class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        }
    }
    
    static long GCD (long a, long b){
	    long candidate = a;
	    while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    }
	    return candidate;
	}
    
    static long LCM (long a, long b){
		long GCD = GCD(a, b);
		//System.out.println("GCD("+a+","+b+") is "+GCD);
		return GCD * (a/GCD) * (b/GCD);
	}
 
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        while(true){
            String tmp = br.readLine();
             
            if(tmp == null){
                break;
            }
 
            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);
             
            System.out.println(GCD(a,b) + " "+ LCM(a,b));
        }
    }
    
    static long GCD (long a, long b){
	    long candidate = a;
	    while (b % a != 0) {
	      candidate = b % a;
	      b = a;
	      a = candidate;
	    }
	    return candidate;
	}
    
    static long LCM (long a, long b){
		long GCD = GCD(a, b);
		//System.out.println("GCD("+a+","+b+") is "+GCD);
		return GCD * (a/GCD) * (b/GCD);
	}
 
}