import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		}
	}
	static long calc(long a, long b) {
		long r = a%b;
		if(r==0) return b;
		return calc(b, r);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		}
	}
	static long calc(long a, long b) {
		long r = a%b;
		if(r==0) return b;
		return calc(b, r);
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		}
	} main {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		}
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		} in.hasNext() in.hasNext in {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		} long a = in.nextInt(); a in.nextInt() in.nextInt in long b = in.nextInt(); b in.nextInt() in.nextInt in System.out.println(calc(a, b) + " " + a*b/calc(a, b)) System.out.println System.out System System.out calc(a, b) + " " + a*b/calc(a, b) calc(a, b) + " " + a*b/calc(a, b) calc(a, b) calc a b " " a*b/calc(a, b) a*b a b calc(a, b) calc a b String[] args args static long calc(long a, long b) {
		long r = a%b;
		if(r==0) return b;
		return calc(b, r);
	} calc {
		long r = a%b;
		if(r==0) return b;
		return calc(b, r);
	} long r = a%b; r a%b a b if(r==0) return b; r==0 r 0 return b; b return calc(b, r); calc(b, r) calc b r long a a long b b public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		}
	}
	static long calc(long a, long b) {
		long r = a%b;
		if(r==0) return b;
		return calc(b, r);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		}
	}
	static long calc(long a, long b) {
		long r = a%b;
		if(r==0) return b;
		return calc(b, r);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			long a = in.nextInt();
			long b = in.nextInt();
			System.out.println(calc(a, b) + " " + a*b/calc(a, b));
		}
	}
	static long calc(long a, long b) {
		long r = a%b;
		if(r==0) return b;
		return calc(b, r);
	}
}