import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		}
	}

	private static long gcd(long a, long b){
		return (a==0)?b:gcd(b%a, a);
	}

	private static long lcm(long a, long b){
		return a*b/gcd(a,b);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		}
	}

	private static long gcd(long a, long b){
		return (a==0)?b:gcd(b%a, a);
	}

	private static long lcm(long a, long b){
		return a*b/gcd(a,b);
	}

} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		}
	} main {
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		}
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		} in.hasNextInt() in.hasNextInt in {
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		} long x=in.nextLong() x in.nextLong() in.nextLong in y = in.nextLong(); y in.nextLong() in.nextLong in System.out.println(gcd(x,y) + " " + lcm(x,y)) System.out.println System.out System System.out gcd(x,y) + " " + lcm(x,y) gcd(x,y) + " " + lcm(x,y) gcd(x,y) gcd x y " " lcm(x,y) lcm x y String[] args args private static long gcd(long a, long b){
		return (a==0)?b:gcd(b%a, a);
	} gcd {
		return (a==0)?b:gcd(b%a, a);
	} return (a==0)?b:gcd(b%a, a); (a==0)?b:gcd(b%a, a) (a==0) a 0 b gcd(b%a, a) gcd b%a b a a long a a long b b private static long lcm(long a, long b){
		return a*b/gcd(a,b);
	} lcm {
		return a*b/gcd(a,b);
	} return a*b/gcd(a,b); a*b/gcd(a,b) a*b a b gcd(a,b) gcd a b long a a long b b public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		}
	}

	private static long gcd(long a, long b){
		return (a==0)?b:gcd(b%a, a);
	}

	private static long lcm(long a, long b){
		return a*b/gcd(a,b);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		}
	}

	private static long gcd(long a, long b){
		return (a==0)?b:gcd(b%a, a);
	}

	private static long lcm(long a, long b){
		return a*b/gcd(a,b);
	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()){
			long x=in.nextLong(), y = in.nextLong();
			System.out.println(gcd(x,y) + " " + lcm(x,y));
		}
	}

	private static long gcd(long a, long b){
		return (a==0)?b:gcd(b%a, a);
	}

	private static long lcm(long a, long b){
		return a*b/gcd(a,b);
	}

}