
import java.io.*;

public class Main {
	 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        String s;
        while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        }
 
    }
    
    private static int gcd(int a, int b) {
    	while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	}
    	return a;
    }
} import java.io.*; io.* java public class Main {
	 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        String s;
        while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        }
 
    }
    
    private static int gcd(int a, int b) {
    	while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	}
    	return a;
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        String s;
        while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        }
 
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        String s;
        while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        }
 
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s; s while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        } (s = br.readLine()) != null (s = br.readLine()) s br.readLine() br.readLine br null {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        } String[] lc = s.split(" "); lc s.split(" ") s.split s " " int a = Integer.parseInt(lc[0]); a Integer.parseInt(lc[0]) Integer.parseInt Integer lc[0] lc 0 int b = Integer.parseInt(lc[1]); b Integer.parseInt(lc[1]) Integer.parseInt Integer lc[1] lc 1 int gcd = gcd(a,b); gcd gcd(a,b) gcd a b int lcm = a / gcd * b; lcm a / gcd * b a / gcd a gcd b System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm String[] args args private static int gcd(int a, int b) {
    	while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	}
    	return a;
    } gcd {
    	while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	}
    	return a;
    } while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	} b!=0 b 0 {
    		int aa = a;
    		a = b;
    		b = aa%b;
    	} int aa = a; aa a a = b a b b = aa%b b aa%b aa b return a; a int a a int b b public class Main {
	 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        String s;
        while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        }
 
    }
    
    private static int gcd(int a, int b) {
    	while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	}
    	return a;
    }
} public class Main {
	 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        String s;
        while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        }
 
    }
    
    private static int gcd(int a, int b) {
    	while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	}
    	return a;
    }
} Main

import java.io.*;

public class Main {
	 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        String s;
        while ((s = br.readLine()) != null) {
            String[] lc = s.split(" ");
            int a = Integer.parseInt(lc[0]);
            int b = Integer.parseInt(lc[1]);
            
            int gcd = gcd(a,b);
            int lcm = a / gcd * b;
            
            System.out.println(gcd + " " + lcm);
        }
 
    }
    
    private static int gcd(int a, int b) {
    	while(b!=0){
    		int aa = a;
    		a = b;
    		b = aa%b;
    	}
    	return a;
    }
}