import java.util.*;
public class Main {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args) {
		while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		}
	}

} import java.util.*; util.* java public class Main {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args) {
		while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		}
	}

} Main static final Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) public static void main(String[] args) {
		while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		}
	} main {
		while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		}
	} while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		} stdin.hasNext() stdin.hasNext stdin {
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		} int a = stdin.nextInt(); a stdin.nextInt() stdin.nextInt stdin int b = stdin.nextInt(); b stdin.nextInt() stdin.nextInt stdin int comp_val = a - b; comp_val a - b a b int num num aval aval m m n n ans1; ans1 if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			} comp_val > 0 comp_val 0 {
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			} for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				} int i = 0; int i = 0; i 0 i <= a i a i++ i++ i {
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				} {
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				} aval = a - i aval a - i a i if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					} a%aval==0 && b%aval==0 a%aval==0 a%aval a aval 0 b%aval==0 b%aval b aval 0 {
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					} m = a/aval m a/aval a aval n = b/aval n b/aval b aval ans1 = m * n * aval ans1 m * n * aval m * n * aval m n aval System.out.println(aval+" "+ans1) System.out.println System.out System System.out aval+" "+ans1 aval+" "+ans1 aval " " ans1 break; {
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			} for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				} int i = 0; int i = 0; i 0 i <= b i b i++ i++ i {
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				} {
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				} aval = b - i aval b - i b i if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					} a%aval==0 && b%aval==0 a%aval==0 a%aval a aval 0 b%aval==0 b%aval b aval 0 {
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					} m = a/aval m a/aval a aval n = b/aval n b/aval b aval ans1 = m * n * aval ans1 m * n * aval m * n * aval m n aval System.out.println(aval+" "+ans1) System.out.println System.out System System.out aval+" "+ans1 aval+" "+ans1 aval " " ans1 break; String[] args args public class Main {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args) {
		while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		}
	}

} public class Main {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args) {
		while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		}
	}

} Main
import java.util.*;
public class Main {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args) {
		while(stdin.hasNext()){
			
			int a = stdin.nextInt();
			int b = stdin.nextInt();
      
			int comp_val = a - b;
			int num, aval,m,n,ans1;
			
			if(comp_val > 0){
				for(int i = 0;i <= a;i++){
					aval = a - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}else{
				for(int i = 0;i <= b;i++){
					aval = b - i;
					if(a%aval==0 && b%aval==0){
						m = a/aval;
						n = b/aval;
						ans1 = m * n * aval;
						System.out.println(aval+" "+ans1);
						
						break;
					}
				}
			}
		}
	}

}