import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		}
	}
	
	public static long gcd(long a,long b){
		if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);}
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io 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[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		}
	}
	
	public static long gcd(long a,long b){
		if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);}
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} 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[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		while((line = br.readLine()) != null){
			String[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = ""; line "" while((line = br.readLine()) != null){
			String[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		} (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
			String[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		} String[] s = line.split(" "); s line.split(" ") line.split line " " long a a b; b a = Long.parseLong(s[0]) a Long.parseLong(s[0]) Long.parseLong Long s[0] s 0 b = Long.parseLong(s[1]) b Long.parseLong(s[1]) Long.parseLong Long s[1] s 1 System.out.println(gcd(a,b) + " " + lcm(a,b)) System.out.println System.out System System.out gcd(a,b) + " " + lcm(a,b) gcd(a,b) + " " + lcm(a,b) gcd(a,b) gcd a b " " lcm(a,b) lcm a b String[] args args public static long gcd(long a,long b){
		if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);}
	} gcd {
		if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);}
	} if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);} a%b == 0 a%b a b 0 { return b;} return b; b { return gcd(b,a%b);} return gcd(b,a%b); 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{
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		while((line = br.readLine()) != null){
			String[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		}
	}
	
	public static long gcd(long a,long b){
		if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);}
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} 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[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		}
	}
	
	public static long gcd(long a,long b){
		if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);}
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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[] s = line.split(" ");
			long a,b;
			a = Long.parseLong(s[0]);
			b = Long.parseLong(s[1]);
			System.out.println(gcd(a,b) + " " + lcm(a,b));
		}
	}
	
	public static long gcd(long a,long b){
		if(a%b == 0){ return b;}
		else{ return gcd(b,a%b);}
	}
	
	public static long lcm(long a,long b){
		return a*b / gcd(a,b);
	}
}