import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		}
		sc.close();
	}

	static long max(long a, long b) {
		return a < b ? b : a;
	}

	static long min(long a, long b) {
		return a < b ? a : b;
	}

	static long abs(long a) {
		return a < 0 ? -a : a;
	}

} import java.util.Scanner; Scanner 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 b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		}
		sc.close();
	}

	static long max(long a, long b) {
		return a < b ? b : a;
	}

	static long min(long a, long b) {
		return a < b ? a : b;
	}

	static long abs(long a) {
		return a < 0 ? -a : a;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNext()) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		} sc.hasNext() sc.hasNext sc {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		} long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			} a == b a b {
				System.out.println(a + " " + 1);
			} System.out.println(a + " " + 1) System.out.println System.out System System.out a + " " + 1 a + " " + 1 a " " 1 {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			} long A = max(a, b); A max(a, b) max a b long B = min(a, b); B min(a, b) min a b long ans1 = 1 ans1 1 ans2 = 1; ans2 1 long rr = A - B; rr A - B A B A = max(B, rr) A max(B, rr) max B rr B = min(B, rr) B min(B, rr) min B rr long r = A - B; r A - B A B while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				} r > 0 r 0 {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				} rr = r rr r A = max(B, rr) A max(B, rr) max B rr B = min(B, rr) B min(B, rr) min B rr r = A - B r A - B A B ans1 = rr ans1 rr ans2 = (a * b) / ans1 ans2 (a * b) / ans1 (a * b) a b ans1 System.out.println(ans1 + " " + ans2) System.out.println System.out System System.out ans1 + " " + ans2 ans1 + " " + ans2 ans1 " " ans2 sc.close() sc.close sc String[] args args static long max(long a, long b) {
		return a < b ? b : a;
	} max {
		return a < b ? b : a;
	} return a < b ? b : a; a < b ? b : a a < b a b b a long a a long b b static long min(long a, long b) {
		return a < b ? a : b;
	} min {
		return a < b ? a : b;
	} return a < b ? a : b; a < b ? a : b a < b a b a b long a a long b b static long abs(long a) {
		return a < 0 ? -a : a;
	} abs {
		return a < 0 ? -a : a;
	} return a < 0 ? -a : a; a < 0 ? -a : a a < 0 a 0 -a a a long a a public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		}
		sc.close();
	}

	static long max(long a, long b) {
		return a < b ? b : a;
	}

	static long min(long a, long b) {
		return a < b ? a : b;
	}

	static long abs(long a) {
		return a < 0 ? -a : a;
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		}
		sc.close();
	}

	static long max(long a, long b) {
		return a < b ? b : a;
	}

	static long min(long a, long b) {
		return a < b ? a : b;
	}

	static long abs(long a) {
		return a < 0 ? -a : a;
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			if (a == b) {
				System.out.println(a + " " + 1);
			} else {
				long A = max(a, b);
				long B = min(a, b);
				long ans1 = 1, ans2 = 1;
				long rr = A - B;
				A = max(B, rr);
				B = min(B, rr);
				long r = A - B;
				while (r > 0) {
					rr = r;
					A = max(B, rr);
					B = min(B, rr);
					r = A - B;
				}
				ans1 = rr;
				ans2 = (a * b) / ans1;
				System.out.println(ans1 + " " + ans2);
			}
		}
		sc.close();
	}

	static long max(long a, long b) {
		return a < b ? b : a;
	}

	static long min(long a, long b) {
		return a < b ? a : b;
	}

	static long abs(long a) {
		return a < 0 ? -a : a;
	}

}