import java.util.Scanner;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args){
		Scanner sc  = new Scanner(System.in);
		
		while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		}
	}
	
	public static long gcd(long a,long b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args){
		Scanner sc  = new Scanner(System.in);
		
		while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		}
	}
	
	public static long gcd(long a,long b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} Main @SuppressWarnings("resource")
	public static void main(String[] args){
		Scanner sc  = new Scanner(System.in);
		
		while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		}
	} main {
		Scanner sc  = new Scanner(System.in);
		
		while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		}
	} Scanner sc  = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		} sc.hasNextLine() sc.hasNextLine sc {
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		} String[] s = sc.nextLine().split("[\\s]+"); s sc.nextLine().split("[\\s]+") sc.nextLine().split sc.nextLine() sc.nextLine sc "[\\s]+" long[] data = new long[s.length]; data new long[s.length] s.length s s.length for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			} int i=0; int i=0; i 0 i<s.length i s.length s s.length i++ i++ i {
				data[i] = Long.parseLong(s[i]);
			} {
				data[i] = Long.parseLong(s[i]);
			} data[i] = Long.parseLong(s[i]) data[i] data i Long.parseLong(s[i]) Long.parseLong Long s[i] s i System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1])) System.out.println System.out System System.out gcd(data[0],data[1])+" "+lcm(data[0],data[1]) gcd(data[0],data[1])+" "+lcm(data[0],data[1]) gcd(data[0],data[1]) gcd data[0] data 0 data[1] data 1 " " lcm(data[0],data[1]) lcm data[0] data 0 data[1] data 1 String[] args args public static long gcd(long a,long 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 long a a long b b public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	} lcm {
		return a*b / gcd(a,b);
	} return a*b / gcd(a,b); a*b / gcd(a,b) a*b a b gcd(a,b) gcd a b long a a long b b public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args){
		Scanner sc  = new Scanner(System.in);
		
		while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		}
	}
	
	public static long gcd(long a,long b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args){
		Scanner sc  = new Scanner(System.in);
		
		while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		}
	}
	
	public static long gcd(long a,long b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} Main
import java.util.Scanner;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args){
		Scanner sc  = new Scanner(System.in);
		
		while(sc.hasNextLine()){
			//double preX,preY;
			String[] s = sc.nextLine().split("[\\s]+");
			long[] data = new long[s.length];
			for(int i=0;i<s.length;i++){
				data[i] = Long.parseLong(s[i]);
			}
			
			System.out.println(gcd(data[0],data[1])+" "+lcm(data[0],data[1]));
			
		}
	}
	
	public static long gcd(long a,long b){
		return b==0 ? a : gcd(b,a%b);
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
}