import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
	public static void main(String... args) {
		Main m = new Main();
		m.solve();
		m.close();
	}

	Scanner sc;
	PrintWriter pw;
	public Main() {
		sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
	}
	private void close() {
		pw.flush();
		pw.close();
	}
	private void solve() {
		while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		}
	}
	// 最大公約数
	public BigInteger gcd(BigInteger l, BigInteger r){
		return l.gcd(r);
	}
	// 最小公倍数
	public BigInteger lcm(BigInteger l, BigInteger r){
		return l.multiply(r).divide(l.gcd(r));
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math public class Main {
	public static void main(String... args) {
		Main m = new Main();
		m.solve();
		m.close();
	}

	Scanner sc;
	PrintWriter pw;
	public Main() {
		sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
	}
	private void close() {
		pw.flush();
		pw.close();
	}
	private void solve() {
		while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		}
	}
	// 最大公約数
	public BigInteger gcd(BigInteger l, BigInteger r){
		return l.gcd(r);
	}
	// 最小公倍数
	public BigInteger lcm(BigInteger l, BigInteger r){
		return l.multiply(r).divide(l.gcd(r));
	}
} Main Scanner sc; sc PrintWriter pw; pw public static void main(String... args) {
		Main m = new Main();
		m.solve();
		m.close();
	} main {
		Main m = new Main();
		m.solve();
		m.close();
	} Main m = new Main(); m new Main() m.solve() m.solve m m.close() m.close m String... args args public Main() {
		sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
	} Main {
		sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
	} sc = new Scanner(System.in) sc new Scanner(System.in) pw = new PrintWriter(System.out) pw new PrintWriter(System.out) private void close() {
		pw.flush();
		pw.close();
	} close {
		pw.flush();
		pw.close();
	} pw.flush() pw.flush pw pw.close() pw.close pw private void solve() {
		while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		}
	} solve {
		while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		}
	} while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		} sc.hasNextLong() sc.hasNextLong sc {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		} BigInteger a = BigInteger.valueOf(sc.nextLong()); a BigInteger.valueOf(sc.nextLong()) BigInteger.valueOf BigInteger sc.nextLong() sc.nextLong sc BigInteger b = BigInteger.valueOf(sc.nextLong()); b BigInteger.valueOf(sc.nextLong()) BigInteger.valueOf BigInteger sc.nextLong() sc.nextLong sc pw.printf("%d %d\n",gcd(a,b),lcm(a,b)) pw.printf pw "%d %d\n" gcd(a,b) gcd a b lcm(a,b) lcm a b // 最大公約数
	public BigInteger gcd(BigInteger l, BigInteger r){
		return l.gcd(r);
	} gcd {
		return l.gcd(r);
	} return l.gcd(r); l.gcd(r) l.gcd l r BigInteger l l BigInteger r r // 最小公倍数
	public BigInteger lcm(BigInteger l, BigInteger r){
		return l.multiply(r).divide(l.gcd(r));
	} lcm {
		return l.multiply(r).divide(l.gcd(r));
	} return l.multiply(r).divide(l.gcd(r)); l.multiply(r).divide(l.gcd(r)) l.multiply(r).divide l.multiply(r) l.multiply l r l.gcd(r) l.gcd l r BigInteger l l BigInteger r r public class Main {
	public static void main(String... args) {
		Main m = new Main();
		m.solve();
		m.close();
	}

	Scanner sc;
	PrintWriter pw;
	public Main() {
		sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
	}
	private void close() {
		pw.flush();
		pw.close();
	}
	private void solve() {
		while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		}
	}
	// 最大公約数
	public BigInteger gcd(BigInteger l, BigInteger r){
		return l.gcd(r);
	}
	// 最小公倍数
	public BigInteger lcm(BigInteger l, BigInteger r){
		return l.multiply(r).divide(l.gcd(r));
	}
} public class Main {
	public static void main(String... args) {
		Main m = new Main();
		m.solve();
		m.close();
	}

	Scanner sc;
	PrintWriter pw;
	public Main() {
		sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
	}
	private void close() {
		pw.flush();
		pw.close();
	}
	private void solve() {
		while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		}
	}
	// 最大公約数
	public BigInteger gcd(BigInteger l, BigInteger r){
		return l.gcd(r);
	}
	// 最小公倍数
	public BigInteger lcm(BigInteger l, BigInteger r){
		return l.multiply(r).divide(l.gcd(r));
	}
} Main
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
	public static void main(String... args) {
		Main m = new Main();
		m.solve();
		m.close();
	}

	Scanner sc;
	PrintWriter pw;
	public Main() {
		sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
	}
	private void close() {
		pw.flush();
		pw.close();
	}
	private void solve() {
		while(sc.hasNextLong()) {
			BigInteger a = BigInteger.valueOf(sc.nextLong());
			BigInteger b = BigInteger.valueOf(sc.nextLong());
			pw.printf("%d %d\n",gcd(a,b),lcm(a,b));
		}
	}
	// 最大公約数
	public BigInteger gcd(BigInteger l, BigInteger r){
		return l.gcd(r);
	}
	// 最小公倍数
	public BigInteger lcm(BigInteger l, BigInteger r){
		return l.multiply(r).divide(l.gcd(r));
	}
}