import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		}
	}
	
	public static int gcd(int a,int b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static int lcm(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);
		int back=max;
		int i=1;
		while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		}
		
		return back;
	}

} 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{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		}
	}
	
	public static int gcd(int a,int b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static int lcm(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);
		int back=max;
		int i=1;
		while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		}
		
		return back;
	}

} Main public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		}
	} main {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		}
	} InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader br = new BufferedReader(is); br new BufferedReader(is) String str; str while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		} (str=br.readLine())!=null (str=br.readLine()) str br.readLine() br.readLine br null {
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		} String[] num=str.split(" "); num str.split(" ") str.split str " " int a=Integer.parseInt(num[0]) a Integer.parseInt(num[0]) Integer.parseInt Integer num[0] num 0 b=Integer.parseInt(num[1]); b Integer.parseInt(num[1]) Integer.parseInt Integer num[1] num 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 public static int gcd(int a,int b){
		return b==0 ? a : gcd(b,a%b);
	} gcd {
		return b==0 ? a : gcd(b,a%b);
	} return b==0 ? a : gcd(b,a%b); b==0 ? a : gcd(b,a%b) b==0 b 0 a gcd(b,a%b) gcd b a%b a b int a a int b b public static int lcm(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);
		int back=max;
		int i=1;
		while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		}
		
		return back;
	} lcm {
		int max=Math.max(a, b);
		int min=Math.min(a, b);
		int back=max;
		int i=1;
		while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		}
		
		return back;
	} int max=Math.max(a, b); max Math.max(a, b) Math.max Math a b int min=Math.min(a, b); min Math.min(a, b) Math.min Math a b int back=max; back max int i=1; i 1 while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		} back%min!=0 back%min back min 0 {
			back=max*i++;
			//System.out.println(back);
		} back=max*i++ back max*i++ max i++ i return back; back int a a int b b public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		}
	}
	
	public static int gcd(int a,int b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static int lcm(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);
		int back=max;
		int i=1;
		while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		}
		
		return back;
	}

} public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		}
	}
	
	public static int gcd(int a,int b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static int lcm(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);
		int back=max;
		int i=1;
		while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		}
		
		return back;
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while((str=br.readLine())!=null){
			String[] num=str.split(" ");
			int a=Integer.parseInt(num[0]),
				b=Integer.parseInt(num[1]);
			System.out.println(gcd(a,b)+" "+lcm(a,b));
			
		}
	}
	
	public static int gcd(int a,int b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static int lcm(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);
		int back=max;
		int i=1;
		while(back%min!=0){
			back=max*i++;
			//System.out.println(back);
		}
		
		return back;
	}

}