import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String input = "";
		
		while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		}
	}
	
	static long gcd(long a, long b){
		long k = a;
		long m = b;
		
		while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		}
		return k;
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util 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 input = "";
		
		while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		}
	}
	
	static long gcd(long a, long b){
		long k = a;
		long m = b;
		
		while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		}
		return k;
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String input = "";
		
		while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String input = "";
		
		while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = ""; input "" while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		} (input = br.readLine()) != null (input = br.readLine()) input br.readLine() br.readLine br null {
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		} String[] arr = input.split(" "); arr input.split(" ") input.split input " " long a = Integer.parseInt(arr[0]); a Integer.parseInt(arr[0]) Integer.parseInt Integer arr[0] arr 0 long b = Integer.parseInt(arr[1]); b Integer.parseInt(arr[1]) Integer.parseInt Integer arr[1] arr 1 long x = gcd(a, b); x gcd(a, b) gcd a b System.out.print(x + " ") System.out.print System.out System System.out x + " " x " " System.out.println((a * b) / x) System.out.println System.out System System.out (a * b) / x (a * b) a b x String[] args args static long gcd(long a, long b){
		long k = a;
		long m = b;
		
		while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		}
		return k;
	} gcd {
		long k = a;
		long m = b;
		
		while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		}
		return k;
	} long k = a; k a long m = b; m b while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		} k != m k m {
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		} if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			} k > m k m {
				k = k - m;
			} k = k - m k k - m k m {
				m = m - k;
			} m = m - k m m - k m k return k; k long a a long b b public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String input = "";
		
		while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		}
	}
	
	static long gcd(long a, long b){
		long k = a;
		long m = b;
		
		while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		}
		return k;
	}

} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String input = "";
		
		while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		}
	}
	
	static long gcd(long a, long b){
		long k = a;
		long m = b;
		
		while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		}
		return k;
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String input = "";
		
		while((input = br.readLine()) != null){
			String[] arr = input.split(" ");
			
			long a = Integer.parseInt(arr[0]);
			long b = Integer.parseInt(arr[1]);
			
			long x = gcd(a, b);
			
			System.out.print(x + " ");
			System.out.println((a * b) / x);
		}
	}
	
	static long gcd(long a, long b){
		long k = a;
		long m = b;
		
		while(k != m){
			if(k > m){
				k = k - m;
			}
			else{
				m = m - k;
			}
		}
		return k;
	}

}