import java.util.Scanner;

class Main{	
	
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		
		while (sc.hasNext()){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = 1;
		for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		}
		System.out.println(n+" "+n*a*b);
		n=1;
		}
	
	}
}  import java.util.Scanner; Scanner java.util class Main{	
	
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		
		while (sc.hasNext()){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = 1;
		for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		}
		System.out.println(n+" "+n*a*b);
		n=1;
		}
	
	}
} Main public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		
		while (sc.hasNext()){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = 1;
		for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		}
		System.out.println(n+" "+n*a*b);
		n=1;
		}
	
	} main {
		Scanner sc = new Scanner(System.in);
		
		while (sc.hasNext()){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = 1;
		for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		}
		System.out.println(n+" "+n*a*b);
		n=1;
		}
	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNext()){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = 1;
		for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		}
		System.out.println(n+" "+n*a*b);
		n=1;
		} sc.hasNext() sc.hasNext sc {
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = 1;
		for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		}
		System.out.println(n+" "+n*a*b);
		n=1;
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int n = 1; n 1 for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		} int i=2; int i=2; i 2 i<=a&&i<=b i<=a i a i<=b i b i+=0 i+=0 i 0 {
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		} {
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		} if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			} a%i==0 &&b%i==0 a%i==0 a%i a i 0 b%i==0 b%i b i 0 {
				n *= i;
				a /= i;
				b /= i;
			} n *= i n i a /= i a i b /= i b i {
				i++;
			} i++ i System.out.println(n+" "+n*a*b) System.out.println System.out System System.out n+" "+n*a*b n+" "+n*a*b n " " n*a*b n*a*b n a b n=1 n 1 String[] args args
import java.util.Scanner;

class Main{	
	
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		
		while (sc.hasNext()){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = 1;
		for(int i=2; i<=a&&i<=b ;i+=0){
			if(a%i==0 &&b%i==0){
				n *= i;
				a /= i;
				b /= i;
			}else{
				i++;
			}
		}
		System.out.println(n+" "+n*a*b);
		n=1;
		}
	
	}
} 