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

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

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

public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line="";
		while((line = br.readLine())!=null){
			String[] s =line.split(" ");
			long a = Long.parseLong(s[0]);
			long b = Long.parseLong(s[1]);
			if(a>b){
				System.out.println(gcd(b,a)+" "+lcm(b,a));
			}else{
				System.out.println(gcd(a,b)+" "+lcm(a,b));
			}
		}
	}
	public static long gcd(long m, long n){
		if(n == 0)
			return m;
		else
			return gcd(n, m % n);
	}
	public static long lcm(long m, long n){
		return m * n / gcd(m, n);
	}
}