import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a, b, tmp, a2, b2;
		while(sc.hasNext()){
			a2 = a = sc.nextInt();
			b2 = b = sc.nextInt();
			
			a %= b;
			while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			}
			System.out.println(b + " " + a2 / b * b2);
		}
	}
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a, b, tmp, a2, b2;
		while(sc.hasNext()){
			a2 = a = sc.nextInt();
			b2 = b = sc.nextInt();
			
			a %= b;
			while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			}
			System.out.println(b + " " + a2 / b * b2);
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a, b, tmp, a2, b2;
		while(sc.hasNext()){
			a2 = a = sc.nextInt();
			b2 = b = sc.nextInt();
			
			a %= b;
			while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			}
			System.out.println(b + " " + a2 / b * b2);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int a, b, tmp, a2, b2;
		while(sc.hasNext()){
			a2 = a = sc.nextInt();
			b2 = b = sc.nextInt();
			
			a %= b;
			while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			}
			System.out.println(b + " " + a2 / b * b2);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a a b b tmp tmp a2 a2 b2; b2 while(sc.hasNext()){
			a2 = a = sc.nextInt();
			b2 = b = sc.nextInt();
			
			a %= b;
			while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			}
			System.out.println(b + " " + a2 / b * b2);
		} sc.hasNext() sc.hasNext sc {
			a2 = a = sc.nextInt();
			b2 = b = sc.nextInt();
			
			a %= b;
			while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			}
			System.out.println(b + " " + a2 / b * b2);
		} a2 = a = sc.nextInt() a2 a = sc.nextInt() a sc.nextInt() sc.nextInt sc b2 = b = sc.nextInt() b2 b = sc.nextInt() b sc.nextInt() sc.nextInt sc a %= b a b while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			} a != 0 a 0 {
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			} tmp = a tmp a a = b a b b = tmp b tmp a %= b a b System.out.println(b + " " + a2 / b * b2) System.out.println System.out System System.out b + " " + a2 / b * b2 b + " " + a2 / b * b2 b " " a2 / b * b2 a2 / b a2 b b2 String[] args args
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a, b, tmp, a2, b2;
		while(sc.hasNext()){
			a2 = a = sc.nextInt();
			b2 = b = sc.nextInt();
			
			a %= b;
			while(a != 0){
				tmp = a;
				a = b;
				b = tmp;
				a %= b;
			}
			System.out.println(b + " " + a2 / b * b2);
		}
	}
}