import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		}
	}
	
	private static int getMin(int a, int b){
		if (a>b){
			return a;
		}else{
			return b;
		}
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		}
	}
	
	private static int getMin(int a, int b){
		if (a>b){
			return a;
		}else{
			return b;
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		} sc.hasNext() sc.hasNext sc {
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		} int[] num = new int[2]; num new int[2] 2 num[0]=sc.nextInt() num[0] num 0 sc.nextInt() sc.nextInt sc num[1]=sc.nextInt() num[1] num 1 sc.nextInt() sc.nextInt sc int cd0; cd0 int cd = 1; cd 1 do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1); cd0 != 1 cd0 1 {
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			} cd0 = 1 cd0 1 for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				} int j = 2; int j = 2; j 2 j<= getMin(num[0], num[1]) j getMin(num[0], num[1]) getMin num[0] num 0 num[1] num 1 j++ j++ j {
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				} {
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				} if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					} num[0]%j == 0 && num[1]%j == 0 num[0]%j == 0 num[0]%j num[0] num 0 j 0 num[1]%j == 0 num[1]%j num[1] num 1 j 0 {
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					} cd0 = j cd0 j cd = cd * j cd cd * j cd j num[0]=num[0]/j num[0] num 0 num[0]/j num[0] num 0 j num[1]=num[1]/j num[1] num 1 num[1]/j num[1] num 1 j break; System.out.print(cd + " ") System.out.print System.out System System.out cd + " " cd " " System.out.println(cd * num[0] * num[1]) System.out.println System.out System System.out cd * num[0] * num[1] cd * num[0] * num[1] cd num[0] num 0 num[1] num 1 String[] args args private static int getMin(int a, int b){
		if (a>b){
			return a;
		}else{
			return b;
		}
	} getMin {
		if (a>b){
			return a;
		}else{
			return b;
		}
	} if (a>b){
			return a;
		}else{
			return b;
		} a>b a b {
			return a;
		} return a; a {
			return b;
		} return b; b int a a int b b public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		}
	}
	
	private static int getMin(int a, int b){
		if (a>b){
			return a;
		}else{
			return b;
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		}
	}
	
	private static int getMin(int a, int b){
		if (a>b){
			return a;
		}else{
			return b;
		}
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int[] num = new int[2];
			num[0]=sc.nextInt();
			num[1]=sc.nextInt();
			
			int cd0;
			int cd = 1;
			
			do{
				cd0 = 1;
				for(int j = 2; j<= getMin(num[0], num[1]); j++){
					if(num[0]%j == 0 && num[1]%j == 0){
						cd0 = j;
						cd = cd * j;
						num[0]=num[0]/j;
						num[1]=num[1]/j;
						break;
					}
				}
			}while(cd0 != 1);
			
			System.out.print(cd + " ");
			System.out.println(cd * num[0] * num[1]);
		}
	}
	
	private static int getMin(int a, int b){
		if (a>b){
			return a;
		}else{
			return b;
		}
	}
}