import java.util.*;
import java.math.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static BigInteger a, b;
	public static void main(String[] args) {
		while(read()){
			solve();
		}

	}
	static boolean read(){
		if(!sc.hasNext())
			return false;
		a = sc.nextBigInteger();
		b = sc.nextBigInteger();
		return true;
	}
	static void solve(){
		System.out.print(gcd(a, b) + " ");
		System.out.println(lcm(a, b, gcd(a, b)));
	}
	static BigInteger gcd(BigInteger a, BigInteger b){
		return a.gcd(b);
	}
	static BigInteger lcm(BigInteger a, BigInteger b, BigInteger gcd){
		return a.multiply(b).divide(gcd);
	}
} import java.util.*; util.* java import java.math.*; math.* java public class Main {
	static Scanner sc = new Scanner(System.in);
	static BigInteger a, b;
	public static void main(String[] args) {
		while(read()){
			solve();
		}

	}
	static boolean read(){
		if(!sc.hasNext())
			return false;
		a = sc.nextBigInteger();
		b = sc.nextBigInteger();
		return true;
	}
	static void solve(){
		System.out.print(gcd(a, b) + " ");
		System.out.println(lcm(a, b, gcd(a, b)));
	}
	static BigInteger gcd(BigInteger a, BigInteger b){
		return a.gcd(b);
	}
	static BigInteger lcm(BigInteger a, BigInteger b, BigInteger gcd){
		return a.multiply(b).divide(gcd);
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static BigInteger a a b; b public static void main(String[] args) {
		while(read()){
			solve();
		}

	} main {
		while(read()){
			solve();
		}

	} while(read()){
			solve();
		} read() read {
			solve();
		} solve() solve String[] args args static boolean read(){
		if(!sc.hasNext())
			return false;
		a = sc.nextBigInteger();
		b = sc.nextBigInteger();
		return true;
	} read {
		if(!sc.hasNext())
			return false;
		a = sc.nextBigInteger();
		b = sc.nextBigInteger();
		return true;
	} if(!sc.hasNext())
			return false; !sc.hasNext() sc.hasNext() sc.hasNext sc return false; false a = sc.nextBigInteger() a sc.nextBigInteger() sc.nextBigInteger sc b = sc.nextBigInteger() b sc.nextBigInteger() sc.nextBigInteger sc return true; true static void solve(){
		System.out.print(gcd(a, b) + " ");
		System.out.println(lcm(a, b, gcd(a, b)));
	} solve {
		System.out.print(gcd(a, b) + " ");
		System.out.println(lcm(a, b, gcd(a, b)));
	} System.out.print(gcd(a, b) + " ") System.out.print System.out System System.out gcd(a, b) + " " gcd(a, b) gcd a b " " System.out.println(lcm(a, b, gcd(a, b))) System.out.println System.out System System.out lcm(a, b, gcd(a, b)) lcm a b gcd(a, b) gcd a b static BigInteger gcd(BigInteger a, BigInteger b){
		return a.gcd(b);
	} gcd {
		return a.gcd(b);
	} return a.gcd(b); a.gcd(b) a.gcd a b BigInteger a a BigInteger b b static BigInteger lcm(BigInteger a, BigInteger b, BigInteger gcd){
		return a.multiply(b).divide(gcd);
	} lcm {
		return a.multiply(b).divide(gcd);
	} return a.multiply(b).divide(gcd); a.multiply(b).divide(gcd) a.multiply(b).divide a.multiply(b) a.multiply a b gcd BigInteger a a BigInteger b b BigInteger gcd gcd public class Main {
	static Scanner sc = new Scanner(System.in);
	static BigInteger a, b;
	public static void main(String[] args) {
		while(read()){
			solve();
		}

	}
	static boolean read(){
		if(!sc.hasNext())
			return false;
		a = sc.nextBigInteger();
		b = sc.nextBigInteger();
		return true;
	}
	static void solve(){
		System.out.print(gcd(a, b) + " ");
		System.out.println(lcm(a, b, gcd(a, b)));
	}
	static BigInteger gcd(BigInteger a, BigInteger b){
		return a.gcd(b);
	}
	static BigInteger lcm(BigInteger a, BigInteger b, BigInteger gcd){
		return a.multiply(b).divide(gcd);
	}
} public class Main {
	static Scanner sc = new Scanner(System.in);
	static BigInteger a, b;
	public static void main(String[] args) {
		while(read()){
			solve();
		}

	}
	static boolean read(){
		if(!sc.hasNext())
			return false;
		a = sc.nextBigInteger();
		b = sc.nextBigInteger();
		return true;
	}
	static void solve(){
		System.out.print(gcd(a, b) + " ");
		System.out.println(lcm(a, b, gcd(a, b)));
	}
	static BigInteger gcd(BigInteger a, BigInteger b){
		return a.gcd(b);
	}
	static BigInteger lcm(BigInteger a, BigInteger b, BigInteger gcd){
		return a.multiply(b).divide(gcd);
	}
} Main
import java.util.*;
import java.math.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static BigInteger a, b;
	public static void main(String[] args) {
		while(read()){
			solve();
		}

	}
	static boolean read(){
		if(!sc.hasNext())
			return false;
		a = sc.nextBigInteger();
		b = sc.nextBigInteger();
		return true;
	}
	static void solve(){
		System.out.print(gcd(a, b) + " ");
		System.out.println(lcm(a, b, gcd(a, b)));
	}
	static BigInteger gcd(BigInteger a, BigInteger b){
		return a.gcd(b);
	}
	static BigInteger lcm(BigInteger a, BigInteger b, BigInteger gcd){
		return a.multiply(b).divide(gcd);
	}
}