import java.util.Scanner;

public class Main {

	private Main() {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	public long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

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

	public static void main(String[] args) {
		new Main();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	private Main() {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	public long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

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

	public static void main(String[] args) {
		new Main();
	}
} Main private Main() {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	} Main {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) long a a b; b while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} in.hasNext() in.hasNext in {
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} a = in.nextInt() a in.nextInt() in.nextInt in b = in.nextInt() b in.nextInt() in.nextInt in System.out.println(gcd(a,b)+" "+lcm(a,b)) System.out.println System.out System System.out gcd(a,b)+" "+lcm(a,b) gcd(a,b)+" "+lcm(a,b) gcd(a,b) gcd a b " " lcm(a,b) lcm a b public long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	} gcd {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	} if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		} a==b a b {
			return a;
		} return a; a if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		} a>b a b {
			return gcd(b,a-b);
		} return gcd(b,a-b); gcd(b,a-b) gcd b a-b a b {
			return gcd(a,b-a);
		} return gcd(a,b-a); gcd(a,b-a) gcd a b-a b a long a a long b b public 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 static void main(String[] args) {
		new Main();
	} main {
		new Main();
	} new Main() String[] args args public class Main {

	private Main() {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	public long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

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

	public static void main(String[] args) {
		new Main();
	}
} public class Main {

	private Main() {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	public long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

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

	public static void main(String[] args) {
		new Main();
	}
} Main
import java.util.Scanner;

public class Main {

	private Main() {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	public long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

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

	public static void main(String[] args) {
		new Main();
	}
}