import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}
	static long gcd(long a,long b){
		if(a%b==0){
			return b;
		}else{
			return gcd(b,a%b);
		}
	}
	static long lcm(long a,long b){
		return a*b/gcd(a,b);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}
	static long gcd(long a,long b){
		if(a%b==0){
			return b;
		}else{
			return gcd(b,a%b);
		}
	}
	static long lcm(long a,long b){
		return a*b/gcd(a,b);
	}
} Main public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	} main {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} sc.hasNext() sc.hasNext sc {
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} long a=sc.nextInt(); a sc.nextInt() sc.nextInt sc long 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 String[] args args 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 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){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}
	static long gcd(long a,long b){
		if(a%b==0){
			return b;
		}else{
			return gcd(b,a%b);
		}
	}
	static long lcm(long a,long b){
		return a*b/gcd(a,b);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}
	static long gcd(long a,long b){
		if(a%b==0){
			return b;
		}else{
			return gcd(b,a%b);
		}
	}
	static long lcm(long a,long b){
		return a*b/gcd(a,b);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextInt();
			long b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}
	static long gcd(long a,long b){
		if(a%b==0){
			return b;
		}else{
			return gcd(b,a%b);
		}
	}
	static long lcm(long a,long b){
		return a*b/gcd(a,b);
	}
}