import java.util.Scanner;
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(int a,int b){
		int c=Math.max(a, b);
		int d=Math.min(a, b);
		while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		}
		return d;
	}
	static int lcm(int a,int b){
		int gcd=gcd(a,b);
		int resa=a/gcd;
		int resb=b/gcd;
		int lcm=resa*resb*gcd;
		return lcm;
	}
} import java.util.Scanner; Scanner 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(int a,int b){
		int c=Math.max(a, b);
		int d=Math.min(a, b);
		while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		}
		return d;
	}
	static int lcm(int a,int b){
		int gcd=gcd(a,b);
		int resa=a/gcd;
		int resb=b/gcd;
		int lcm=resa*resb*gcd;
		return lcm;
	}
} 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(int a,int b){
		int c=Math.max(a, b);
		int d=Math.min(a, b);
		while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		}
		return d;
	} gcd {
		int c=Math.max(a, b);
		int d=Math.min(a, b);
		while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		}
		return d;
	} int c=Math.max(a, b); c Math.max(a, b) Math.max Math a b int d=Math.min(a, b); d Math.min(a, b) Math.min Math a b while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		} c%d!=0 c%d c d 0 {
			int e=c%d;
			c=d;
			d=e;
		} int e=c%d; e c%d c d c=d c d d=e d e return d; d int a a int b b static int lcm(int a,int b){
		int gcd=gcd(a,b);
		int resa=a/gcd;
		int resb=b/gcd;
		int lcm=resa*resb*gcd;
		return lcm;
	} lcm {
		int gcd=gcd(a,b);
		int resa=a/gcd;
		int resb=b/gcd;
		int lcm=resa*resb*gcd;
		return lcm;
	} int gcd=gcd(a,b); gcd gcd(a,b) gcd a b int resa=a/gcd; resa a/gcd a gcd int resb=b/gcd; resb b/gcd b gcd int lcm=resa*resb*gcd; lcm resa*resb*gcd resa*resb*gcd resa resb gcd return lcm; lcm int a a int 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(int a,int b){
		int c=Math.max(a, b);
		int d=Math.min(a, b);
		while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		}
		return d;
	}
	static int lcm(int a,int b){
		int gcd=gcd(a,b);
		int resa=a/gcd;
		int resb=b/gcd;
		int lcm=resa*resb*gcd;
		return lcm;
	}
} 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(int a,int b){
		int c=Math.max(a, b);
		int d=Math.min(a, b);
		while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		}
		return d;
	}
	static int lcm(int a,int b){
		int gcd=gcd(a,b);
		int resa=a/gcd;
		int resb=b/gcd;
		int lcm=resa*resb*gcd;
		return lcm;
	}
} Main
import java.util.Scanner;
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(int a,int b){
		int c=Math.max(a, b);
		int d=Math.min(a, b);
		while(c%d!=0){
			int e=c%d;
			c=d;
			d=e;
		}
		return d;
	}
	static int lcm(int a,int b){
		int gcd=gcd(a,b);
		int resa=a/gcd;
		int resb=b/gcd;
		int lcm=resa*resb*gcd;
		return lcm;
	}
}