import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		sc.close();
	}
	
	static int gcd(long a,long b){	//最大公約数
		if(a<b) return gcd(b,a);	//入れ換えて再実行
		long d=0;
		do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0);
		return (int)a;
	}

	static int lcm(long a,long b){	//最小公倍数
		return (int)(a*b/gcd(a,b));
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		sc.close();
	}
	
	static int gcd(long a,long b){	//最大公約数
		if(a<b) return gcd(b,a);	//入れ換えて再実行
		long d=0;
		do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0);
		return (int)a;
	}

	static int lcm(long a,long b){	//最小公倍数
		return (int)(a*b/gcd(a,b));
	}
} Main public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		sc.close();
	} main {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		sc.close();
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} sc.hasNextInt() sc.hasNextInt sc {
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int b=sc.nextInt(); b sc.nextInt() sc.nextInt sc 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 sc.close() sc.close sc String[] args args static int gcd(long a,long b){	//最大公約数
		if(a<b) return gcd(b,a);	//入れ換えて再実行
		long d=0;
		do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0);
		return (int)a;
	} gcd {	//最大公約数
		if(a<b) return gcd(b,a);	//入れ換えて再実行
		long d=0;
		do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0);
		return (int)a;
	} if(a<b) return gcd(b,a);	//入れ換えて再実行 a<b a b return gcd(b,a);	//入れ換えて再実行 gcd(b,a) gcd b a long d=0; d 0 do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0); d!=0 d 0 {
			d=a%b;
			a=b;
			b=d;
		} d=a%b d a%b a b a=b a b b=d b d return (int)a; (int)a long a a long b b static int lcm(long a,long b){	//最小公倍数
		return (int)(a*b/gcd(a,b));
	} lcm {	//最小公倍数
		return (int)(a*b/gcd(a,b));
	} return (int)(a*b/gcd(a,b)); (int)(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){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		sc.close();
	}
	
	static int gcd(long a,long b){	//最大公約数
		if(a<b) return gcd(b,a);	//入れ換えて再実行
		long d=0;
		do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0);
		return (int)a;
	}

	static int lcm(long a,long b){	//最小公倍数
		return (int)(a*b/gcd(a,b));
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		sc.close();
	}
	
	static int gcd(long a,long b){	//最大公約数
		if(a<b) return gcd(b,a);	//入れ換えて再実行
		long d=0;
		do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0);
		return (int)a;
	}

	static int lcm(long a,long b){	//最小公倍数
		return (int)(a*b/gcd(a,b));
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextInt()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		sc.close();
	}
	
	static int gcd(long a,long b){	//最大公約数
		if(a<b) return gcd(b,a);	//入れ換えて再実行
		long d=0;
		do{
			d=a%b;
			a=b;
			b=d;
		}while(d!=0);
		return (int)a;
	}

	static int lcm(long a,long b){	//最小公倍数
		return (int)(a*b/gcd(a,b));
	}
}