import java.util.*;
import java.io.*;
import java.math.*;



public class Main {
	
	private static long gcd(long n, long m) {
//		int tmp = 0;
		while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		}
		
		
		return n;
	}

//	private static int lcm(int n, int m) {
//		return n*m/gcd(n,  m);
//	}
	
	public static void main(String[] args) throws IOException{
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        }

        
	}
}
  import java.util.*; util.* java import java.io.*; io.* java import java.math.*; math.* java public class Main {
	
	private static long gcd(long n, long m) {
//		int tmp = 0;
		while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		}
		
		
		return n;
	}

//	private static int lcm(int n, int m) {
//		return n*m/gcd(n,  m);
//	}
	
	public static void main(String[] args) throws IOException{
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        }

        
	}
} Main private static long gcd(long n, long m) {
//		int tmp = 0;
		while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		}
		
		
		return n;
	} gcd {
//		int tmp = 0;
		while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		}
		
		
		return n;
	} while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		} n != m n m {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		} if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			} n > m n m {
				n -= m;
			} n -= m n m {
				m-= n;
			} m-= n m n return n; n long n n long m m public static void main(String[] args) throws IOException{
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        }

        
	} main {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        }

        
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        } scan.hasNext() scan.hasNext scan {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        } long n = scan.nextInt(); n scan.nextInt() scan.nextInt scan long m = scan.nextInt(); m scan.nextInt() scan.nextInt scan long gcd = gcd(n, m); gcd gcd(n, m) gcd n m System.out.println(gcd + " " + n * m / gcd) System.out.println System.out System System.out gcd + " " + n * m / gcd gcd + " " + n * m / gcd gcd " " n * m / gcd n * m n m gcd String[] args args public class Main {
	
	private static long gcd(long n, long m) {
//		int tmp = 0;
		while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		}
		
		
		return n;
	}

//	private static int lcm(int n, int m) {
//		return n*m/gcd(n,  m);
//	}
	
	public static void main(String[] args) throws IOException{
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        }

        
	}
} public class Main {
	
	private static long gcd(long n, long m) {
//		int tmp = 0;
		while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		}
		
		
		return n;
	}

//	private static int lcm(int n, int m) {
//		return n*m/gcd(n,  m);
//	}
	
	public static void main(String[] args) throws IOException{
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        }

        
	}
} Main
import java.util.*;
import java.io.*;
import java.math.*;



public class Main {
	
	private static long gcd(long n, long m) {
//		int tmp = 0;
		while(n != m) {
			if(n > m) {
				n -= m;
			}
			else {
				m-= n;
			}
		}
		
		
		return n;
	}

//	private static int lcm(int n, int m) {
//		return n*m/gcd(n,  m);
//	}
	
	public static void main(String[] args) throws IOException{
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
        	long n = scan.nextInt();
        	long m = scan.nextInt();
        	long gcd = gcd(n, m);
        	System.out.println(gcd + " " + n * m / gcd);
        	
        }

        
	}
}
 