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;}
		for(long i=1; i<=(long)(Math.sqrt(min)+1); i++){
			if(min % i == 0){
				long tmp = min / i;
				if((max % tmp) == 0){
					gcd = tmp;
					break;
				}
			}
		}
		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;
        }
    }
    //最小公倍数を求めるメソッド
    static long findlcm(long x, long y){
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    }
	
	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;}
		for(long i=1; i<=(long)(Math.sqrt(min)+1); i++){
			if(min % i == 0){
				long tmp = min / i;
				if((max % tmp) == 0){
					gcd = tmp;
					break;
				}
			}
		}
		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;
        }
    }
    //最小公倍数を求めるメソッド
    static long findlcm(long x, long y){
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    }
	
	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 //最大公約数を求めるメソッド
    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;
        }
    } findGcd {
        if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        }
    } if(x%y==0){
            return y;
        }else{
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        } x%y==0 x%y x y 0 {
            return y;
        } return y; y {
            long m = 1;
            while(m!=0){
                m = y%x;
                y = x;
                x = m;
            }
            return y;
        } long m = 1; m 1 while(m!=0){
                m = y%x;
                y = x;
                x = m;
            } m!=0 m 0 {
                m = y%x;
                y = x;
                x = m;
            } m = y%x m y%x y x y = x y x x = m x m return y; y long x x long y y //最小公倍数を求めるメソッド
    static long findlcm(long x, long y){
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    } findlcm {
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    } for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        } long i=1; long i=1; i 1 i<=x i x i++ i++ i {
            if(y*i%x==0){
                return y*i;
            }
        } {
            if(y*i%x==0){
                return y*i;
            }
        } if(y*i%x==0){
                return y*i;
            } y*i%x==0 y*i%x y*i y i x 0 {
                return y*i;
            } return y*i; y*i y i return 0; 0 long x x long y 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 {
		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;}
		for(long i=1; i<=(long)(Math.sqrt(min)+1); i++){
			if(min % i == 0){
				long tmp = min / i;
				if((max % tmp) == 0){
					gcd = tmp;
					break;
				}
			}
		}
		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;
        }
    }
    //最小公倍数を求めるメソッド
    static long findlcm(long x, long y){
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    }
	
	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;}
		for(long i=1; i<=(long)(Math.sqrt(min)+1); i++){
			if(min % i == 0){
				long tmp = min / i;
				if((max % tmp) == 0){
					gcd = tmp;
					break;
				}
			}
		}
		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;
        }
    }
    //最小公倍数を求めるメソッド
    static long findlcm(long x, long y){
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    }
	
	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;}
		for(long i=1; i<=(long)(Math.sqrt(min)+1); i++){
			if(min % i == 0){
				long tmp = min / i;
				if((max % tmp) == 0){
					gcd = tmp;
					break;
				}
			}
		}
		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;
        }
    }
    //最小公倍数を求めるメソッド
    static long findlcm(long x, long y){
        for(long i=1; i<=x; i++){
            if(y*i%x==0){
                return y*i;
            }
        }
        return 0;
    }
	
	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);
		}
	}
}