import java.util.*;
public class Main {

	public void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		}
	}

	private int gcd(int a, int b){
		if(b == 0) return a;
		else return gcd(b, a % b);
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();
	}

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

	public void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		}
	}

	private int gcd(int a, int b){
		if(b == 0) return a;
		else return gcd(b, a % b);
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();
	}

} Main public void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		}
	} doIt {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		} sc.hasNext() sc.hasNext sc {
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		} int input1 = sc.nextInt(); input1 sc.nextInt() sc.nextInt sc int input2 = sc.nextInt(); input2 sc.nextInt() sc.nextInt sc int gcd = gcd(input1, input2); gcd gcd(input1, input2) gcd input1 input2 int lcm = input1 / gcd * input2; lcm input1 / gcd * input2 input1 / gcd input1 gcd input2 System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm private int gcd(int a, int b){
		if(b == 0) return a;
		else return gcd(b, a % b);
	} gcd {
		if(b == 0) return a;
		else return gcd(b, a % b);
	} if(b == 0) return a;
		else return gcd(b, a % b); b == 0 b 0 return a; a return gcd(b, a % b); gcd(b, a % b) gcd b a % b a b int a a int b b public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();
	} main {
		Main obj = new Main();
		obj.doIt();
	} Main obj = new Main(); obj new Main() obj.doIt() obj.doIt obj String[] args args public class Main {

	public void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		}
	}

	private int gcd(int a, int b){
		if(b == 0) return a;
		else return gcd(b, a % b);
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();
	}

} public class Main {

	public void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		}
	}

	private int gcd(int a, int b){
		if(b == 0) return a;
		else return gcd(b, a % b);
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();
	}

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

	public void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input1 = sc.nextInt();
			int input2 = sc.nextInt();
			//gcd
			int gcd = gcd(input1, input2);
			//lcm
			int lcm = input1 / gcd * input2;
			System.out.println(gcd + " " + lcm);
		}
	}

	private int gcd(int a, int b){
		if(b == 0) return a;
		else return gcd(b, a % b);
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();
	}

}