import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static int gcd(int a, int b){
		if(b == 0) return a;
		return gcd(b,a % b);
    }
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		}
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	static int gcd(int a, int b){
		if(b == 0) return a;
		return gcd(b,a % b);
    }
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		}
	}
} Main static int gcd(int a, int b){
		if(b == 0) return a;
		return gcd(b,a % b);
    } gcd {
		if(b == 0) return a;
		return gcd(b,a % b);
    } if(b == 0) return a; b == 0 b 0 return a; a return gcd(b,a % b); gcd(b,a % b) gcd b a % b a b int a a int b b public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		}
	} main {
		Scanner in = new Scanner(System.in);
		while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		}
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		} true {
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		} try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			} catch(Exception e){
				System.exit(0);
			} Exception e {
				System.exit(0);
			} System.exit(0) System.exit System 0 {
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			} int a = in.nextInt(); a in.nextInt() in.nextInt in int b = in.nextInt(); b in.nextInt() in.nextInt in int min = gcd(a,b); min gcd(a,b) gcd a b int max = 1; max 1 for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				} int i = 2; int i = 2; i 2 i < Math.pow(a + b, 0.5) + 1 i Math.pow(a + b, 0.5) + 1 Math.pow(a + b, 0.5) Math.pow Math a + b a b 0.5 1 i++ i++ i {
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				} {
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				} if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					} a % i == 0 && b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 {
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					} max = max * i max max * i max i a = a / i a a / i a i b = b / i b b / i b i i-- i max = max * a * b max max * a * b max * a * b max a b System.out.println(min + " " + max) System.out.println System.out System System.out min + " " + max min + " " + max min " " max String[] args args public class Main {
	static int gcd(int a, int b){
		if(b == 0) return a;
		return gcd(b,a % b);
    }
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		}
	}
} public class Main {
	static int gcd(int a, int b){
		if(b == 0) return a;
		return gcd(b,a % b);
    }
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		}
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static int gcd(int a, int b){
		if(b == 0) return a;
		return gcd(b,a % b);
    }
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			try{
				int a = in.nextInt();
				int b = in.nextInt();
				int min = gcd(a,b);
				int max = 1;
				for(int i = 2;i < Math.pow(a + b, 0.5) + 1;i++){
					if(a % i == 0 && b % i == 0){
						max = max * i;
						a = a / i;
						b = b / i;
						i--;
					}
				}
				max = max * a * b;
				System.out.println(min + " " + max);
			}catch(Exception e){
				System.exit(0);
			}
		}
	}
}