import java.util.Scanner;

public class Main{
static int LONGEST=2000000000;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		//System.out.print("Input -> ");
		while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		}
	}
	
	public static long LCM(long a,long b){
		long max=Math.max(a, b),ans=0;
		long min;
		
		if(max==a){
			min=b;
		}else{
			min=a;
		}
		for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		}
		return ans;
	}
	
	public static long GCD(long a,long b){
		long gcd;
		if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		}
		return gcd;
	}

} import java.util.Scanner; Scanner java.util public class Main{
static int LONGEST=2000000000;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		//System.out.print("Input -> ");
		while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		}
	}
	
	public static long LCM(long a,long b){
		long max=Math.max(a, b),ans=0;
		long min;
		
		if(max==a){
			min=b;
		}else{
			min=a;
		}
		for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		}
		return ans;
	}
	
	public static long GCD(long a,long b){
		long gcd;
		if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		}
		return gcd;
	}

} Main static int LONGEST=2000000000; LONGEST 2000000000 /**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		//System.out.print("Input -> ");
		while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		}
	} main {
		Scanner sc= new Scanner(System.in);
		//System.out.print("Input -> ");
		while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		}
	} Scanner sc= new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		} sc.hasNext() sc.hasNext sc {
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		} long a =sc.nextLong(); a sc.nextLong() sc.nextLong 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 public static long LCM(long a,long b){
		long max=Math.max(a, b),ans=0;
		long min;
		
		if(max==a){
			min=b;
		}else{
			min=a;
		}
		for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		}
		return ans;
	} LCM {
		long max=Math.max(a, b),ans=0;
		long min;
		
		if(max==a){
			min=b;
		}else{
			min=a;
		}
		for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		}
		return ans;
	} long max=Math.max(a, b) max Math.max(a, b) Math.max Math a b ans=0; ans 0 long min; min if(max==a){
			min=b;
		}else{
			min=a;
		} max==a max a {
			min=b;
		} min=b min b {
			min=a;
		} min=a min a for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		} long i=1; long i=1; i 1 i<=LONGEST i LONGEST i++ i++ i {
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		} {
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		} if((max*i)%min==0){
				ans=max*i;
				 break;
			} (max*i)%min==0 (max*i)%min (max*i) max i min 0 {
				ans=max*i;
				 break;
			} ans=max*i ans max*i max i break; return ans; ans long a a long b b public static long GCD(long a,long b){
		long gcd;
		if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		}
		return gcd;
	} GCD {
		long gcd;
		if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		}
		return gcd;
	} long gcd; gcd if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		} b==0 b 0 {
			gcd=a;
		} gcd=a gcd a {
			gcd=GCD(b,a%b);
		} gcd=GCD(b,a%b) gcd GCD(b,a%b) GCD b a%b a b return gcd; gcd long a a long b b public class Main{
static int LONGEST=2000000000;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		//System.out.print("Input -> ");
		while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		}
	}
	
	public static long LCM(long a,long b){
		long max=Math.max(a, b),ans=0;
		long min;
		
		if(max==a){
			min=b;
		}else{
			min=a;
		}
		for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		}
		return ans;
	}
	
	public static long GCD(long a,long b){
		long gcd;
		if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		}
		return gcd;
	}

} public class Main{
static int LONGEST=2000000000;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		//System.out.print("Input -> ");
		while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		}
	}
	
	public static long LCM(long a,long b){
		long max=Math.max(a, b),ans=0;
		long min;
		
		if(max==a){
			min=b;
		}else{
			min=a;
		}
		for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		}
		return ans;
	}
	
	public static long GCD(long a,long b){
		long gcd;
		if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		}
		return gcd;
	}

} Main
import java.util.Scanner;

public class Main{
static int LONGEST=2000000000;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		//System.out.print("Input -> ");
		while(sc.hasNext()){
			long a =sc.nextLong();
			long b =sc.nextInt();
			
			//System.out.println("input="+a+" "+b);
			//System.out.println("LCM="+LCM(a,b)+" "+"GCD="+GCD(a,b));
			System.out.println(GCD(a,b)+" "+LCM(a,b));
			//System.out.print("Next Input -> ");
		}
	}
	
	public static long LCM(long a,long b){
		long max=Math.max(a, b),ans=0;
		long min;
		
		if(max==a){
			min=b;
		}else{
			min=a;
		}
		for(long i=1;i<=LONGEST;i++){
			if((max*i)%min==0){
				ans=max*i;
				 break;
			}
		}
		return ans;
	}
	
	public static long GCD(long a,long b){
		long gcd;
		if(b==0){
			gcd=a;
		}else{
			gcd=GCD(b,a%b);
		}
		return gcd;
	}

}