import java.io.*;
import java.util.ArrayList;
public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while ((line = br.readLine()) != null) {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        }
	}
} import java.io.*; io.* java import java.util.ArrayList; ArrayList java.util public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while ((line = br.readLine()) != null) {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        }
	}
} Main public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while ((line = br.readLine()) != null) {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        }
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while ((line = br.readLine()) != null) {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			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[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        } String[] numbers = line.split(" "); numbers line.split(" ") line.split line " " int a = Integer.parseInt(numbers[0]); a Integer.parseInt(numbers[0]) Integer.parseInt Integer numbers[0] numbers 0 int b = Integer.parseInt(numbers[1]); b Integer.parseInt(numbers[1]) Integer.parseInt Integer numbers[1] numbers 1 int a2 = a; a2 a int b2 = b; b2 b int limit = Math.min(a, b); limit Math.min(a, b) Math.min Math a b ArrayList<Integer> elements = new ArrayList<Integer>(); elements new ArrayList<Integer>() for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			} int i = limit; int i = limit; i limit i > 1 i 1 i-- i-- i {
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			} {
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			} if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				} a % i == 0 && b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 {
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				} a /= i a i b /= i b i elements.add(i) elements.add elements i continue; int gcd = 1; gcd 1 for(int i : elements){
				gcd *= i;
			} int i elements {
				gcd *= i;
			} {
				gcd *= i;
			} gcd *= i gcd i int lcm = (a2 / gcd) * b2; lcm (a2 / gcd) * b2 (a2 / gcd) a2 gcd b2 System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm String[] args args public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while ((line = br.readLine()) != null) {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        }
	}
} public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while ((line = br.readLine()) != null) {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        }
	}
} Main
import java.io.*;
import java.util.ArrayList;
public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while ((line = br.readLine()) != null) {
			String[] numbers = line.split(" ");
			int a = Integer.parseInt(numbers[0]);
			int b = Integer.parseInt(numbers[1]);
			int a2 = a;
			int b2 = b;
			
			
			int limit = Math.min(a, b);
			ArrayList<Integer> elements = new ArrayList<Integer>();
			
			for (int i = limit; i > 1; i--){
				if (a % i == 0 && b % i == 0){
					a /= i;
					b /= i;
					elements.add(i);  
					continue;
				}
			}
			
			int gcd = 1;
			for(int i : elements){
				gcd *= i;
			}
			
			int lcm = (a2 / gcd) * b2;
			System.out.println(gcd + " " + lcm);
        }
	}
}