import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		}
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		}
	} main {
		Scanner sc = new Scanner (System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		}
	} Scanner sc = new Scanner (System.in); sc new Scanner (System.in) while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		} sc.hasNext() sc.hasNext sc {
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		} long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long a1 = a; a1 a long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long b1 = b; b1 b long i; i if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			} a > b a b {
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			} for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				} ; {
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				} {
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				} if(a1 % b == 0){
						break;
					} a1 % b == 0 a1 % b a1 b 0 {
						break;
					} break; a1 += a a1 a if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				} a % b == 0 a % b a b 0 {
					System.out.println(b + " " + a1 );
				} System.out.println(b + " " + a1 ) System.out.println System.out System System.out b + " " + a1 b + " " + a1 b " " a1 {
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				} for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					} i = b / 2; i = b / 2 i b / 2 b 2 i > 0 i 0 i-- i-- i {
						if(a % i == 0 && b % i == 0){
							break;
						}
					} {
						if(a % i == 0 && b % i == 0){
							break;
						}
					} if(a % i == 0 && b % i == 0){
							break;
						} a % i == 0 && b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 {
							break;
						} break; System.out.println(i + " " + a1 ) System.out.println System.out System System.out i + " " + a1 i + " " + a1 i " " a1 if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			} a < b a b {
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			} for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				} ; {
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				} {
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				} if(b1 % a == 0){
						break;
					} b1 % a == 0 b1 % a b1 a 0 {
						break;
					} break; b1 += b b1 b if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				} b % a == 0 b % a b a 0 {
					System.out.println(a + " " + b1 );
				} System.out.println(a + " " + b1 ) System.out.println System.out System System.out a + " " + b1 a + " " + b1 a " " b1 {
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				} for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					} i = a / 2; i = a / 2 i a / 2 a 2 i > 0 i 0 i-- i-- i {
						if(a % i == 0 && b % i == 0){
							break;
						}
					} {
						if(a % i == 0 && b % i == 0){
							break;
						}
					} if(a % i == 0 && b % i == 0){
							break;
						} a % i == 0 && b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 {
							break;
						} break; System.out.println(i + " " + b1 ) System.out.println System.out System System.out i + " " + b1 i + " " + b1 i " " b1 {
				System.out.println(b + " " + b1 );
			} System.out.println(b + " " + b1 ) System.out.println System.out System System.out b + " " + b1 b + " " + b1 b " " b1 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		}
	}

} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long a1 = a;
			long b = sc.nextLong();
			long b1 = b;
			long i;
			if(a > b){
				for(;;){
					if(a1 % b == 0){
						break;
					}
					a1 += a;
				}
				if(a % b == 0){
					System.out.println(b + " " + a1 );
				}
				else{
					for(i = b / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + a1 );
				}
			}
			else if(a < b){
				for(;;){
					if(b1 % a == 0){
						break;
					}
					b1 += b;
				}
				if(b % a == 0){
					System.out.println(a + " " + b1 );
				}
				else{
					for(i = a / 2; i > 0; i--){
						if(a % i == 0 && b % i == 0){
							break;
						}
					}
					System.out.println(i + " " + b1 );
				}	
			}
			else{
				System.out.println(b + " " + b1 );
			}
		}
	}

}