import java.io.*;

public class Main{
	
	public static long findGcd(long f1, long f2){
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		
		if(max % min == 0){
			return min;
		}
		
		for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		}
		return gcd;
	}
	
	
	public static long findlcm(long f1, long f2){
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	}
	
	/*
	//最大公約数を求めるメソッド
    static long findGcd(long x, long y){
        if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        }
    }
    */
	
	public static void main(String[] argv) throws NumberFormatException, IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	}
} import java.io.*; io.* java public class Main{
	
	public static long findGcd(long f1, long f2){
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		
		if(max % min == 0){
			return min;
		}
		
		for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		}
		return gcd;
	}
	
	
	public static long findlcm(long f1, long f2){
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	}
	
	/*
	//最大公約数を求めるメソッド
    static long findGcd(long x, long y){
        if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        }
    }
    */
	
	public static void main(String[] argv) throws NumberFormatException, IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	}
} Main public static long findGcd(long f1, long f2){
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		
		if(max % min == 0){
			return min;
		}
		
		for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		}
		return gcd;
	} findGcd {
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		
		if(max % min == 0){
			return min;
		}
		
		for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		}
		return gcd;
	} long gcd = 1; gcd 1 long max max min; min if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;} f1 > f2 f1 f2 {max = f1; min = f2;} max = f1 max f1 min = f2 min f2 {max = f2; min = f1;} max = f2 max f2 min = f1 min f1 if(max % min == 0){
			return min;
		} max % min == 0 max % min max min 0 {
			return min;
		} return min; min for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		} long i=1; long i=1; i 1 i<(long)(Math.sqrt(min)+1) i (long)(Math.sqrt(min)+1) Math.sqrt(min) Math.sqrt Math min 1 i++ i++ i {
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		} {
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		} if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			} (min % i) == 0 (min % i) min i 0 {
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			} if((max % i) == 0){
					if(gcd < i)gcd = i;
				} (max % i) == 0 (max % i) max i 0 {
					if(gcd < i)gcd = i;
				} if(gcd < i)gcd = i; gcd < i gcd i gcd = i gcd i long tmp = min/i; tmp min/i min i if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				} (max % tmp) == 0 (max % tmp) max tmp 0 {
					if(gcd < tmp)gcd = tmp;
				} if(gcd < tmp)gcd = tmp; gcd < tmp gcd tmp gcd = tmp gcd tmp return gcd; gcd long f1 f1 long f2 f2 public static long findlcm(long f1, long f2){
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	} findlcm {
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	} long lcm = 0; lcm 0 long max max min; min if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;} f1 > f2 f1 f2 {max = f1; min = f2;} max = f1 max f1 min = f2 min f2 {max = f2; min = f1;} max = f2 max f2 min = f1 min f1 long i=1; i 1 while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		} lcm == 0 lcm 0 {
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		} if((max * i)%min == 0){
				lcm = max * i;
			} (max * i)%min == 0 (max * i)%min (max * i) max i min 0 {
				lcm = max * i;
			} lcm = max * i lcm max * i max i i++ i return lcm; lcm long f1 f1 long f2 f2 public static void main(String[] argv) throws NumberFormatException, IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line; line while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		} (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		} String[] lineArray = line.split(" "); lineArray line.split(" ") line.split line " " long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])}; factor {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])} Long.parseLong(lineArray[0]) Long.parseLong Long lineArray[0] lineArray 0 Long.parseLong(lineArray[1]) Long.parseLong Long lineArray[1] lineArray 1 long gcd = findGcd(factor[0], factor[1]); gcd findGcd(factor[0], factor[1]) findGcd factor[0] factor 0 factor[1] factor 1 long lcm = findlcm(factor[0], factor[1]); lcm findlcm(factor[0], factor[1]) findlcm factor[0] factor 0 factor[1] factor 1 System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm String[] argv argv public class Main{
	
	public static long findGcd(long f1, long f2){
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		
		if(max % min == 0){
			return min;
		}
		
		for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		}
		return gcd;
	}
	
	
	public static long findlcm(long f1, long f2){
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	}
	
	/*
	//最大公約数を求めるメソッド
    static long findGcd(long x, long y){
        if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        }
    }
    */
	
	public static void main(String[] argv) throws NumberFormatException, IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	}
} public class Main{
	
	public static long findGcd(long f1, long f2){
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		
		if(max % min == 0){
			return min;
		}
		
		for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		}
		return gcd;
	}
	
	
	public static long findlcm(long f1, long f2){
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	}
	
	/*
	//最大公約数を求めるメソッド
    static long findGcd(long x, long y){
        if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        }
    }
    */
	
	public static void main(String[] argv) throws NumberFormatException, IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	}
} Main
import java.io.*;

public class Main{
	
	public static long findGcd(long f1, long f2){
		long gcd = 1;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		
		if(max % min == 0){
			return min;
		}
		
		for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
			if((min % i) == 0){
				if((max % i) == 0){
					if(gcd < i)gcd = i;
				}
				long tmp = min/i;
				if((max % tmp) == 0){
					if(gcd < tmp)gcd = tmp;
				}
			}
		}
		return gcd;
	}
	
	
	public static long findlcm(long f1, long f2){
		long lcm = 0;
		long max, min;
		if(f1 > f2){max = f1; min = f2;}
		else{max = f2; min = f1;}
		long i=1;
		while(lcm == 0){
			if((max * i)%min == 0){
				lcm = max * i;
			}
			i++;
		}
		return lcm;
	}
	
	/*
	//最大公約数を求めるメソッド
    static long findGcd(long x, long y){
        if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        }
    }
    */
	
	public static void main(String[] argv) throws NumberFormatException, IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			String[] lineArray = line.split(" ");
			long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
			long gcd = findGcd(factor[0], factor[1]);
			long lcm = findlcm(factor[0], factor[1]);
			System.out.println(gcd + " " + lcm);
		}
	}
}