import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static long gcd(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);

		int amari=max%min;
		if(amari==0)return min;
		return gcd(min,amari);
	}

	private static int lcm(long a,long b){
		return (int) (a*b/gcd((int)a,(int)b));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static long gcd(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);

		int amari=max%min;
		if(amari==0)return min;
		return gcd(min,amari);
	}

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

		int amari=max%min;
		if(amari==0)return min;
		return gcd(min,amari);
	} gcd {
		int max=Math.max(a, b);
		int min=Math.min(a, b);

		int amari=max%min;
		if(amari==0)return min;
		return gcd(min,amari);
	} int max=Math.max(a, b); max Math.max(a, b) Math.max Math a b int min=Math.min(a, b); min Math.min(a, b) Math.min Math a b int amari=max%min; amari max%min max min if(amari==0)return min; amari==0 amari 0 return min; min return gcd(min,amari); gcd(min,amari) gcd min amari int a a int b b private static int lcm(long a,long b){
		return (int) (a*b/gcd((int)a,(int)b));
	} lcm {
		return (int) (a*b/gcd((int)a,(int)b));
	} return (int) (a*b/gcd((int)a,(int)b)); (int) (a*b/gcd((int)a,(int)b)) a*b a b gcd((int)a,(int)b) gcd (int)a (int)b long a a long b b public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static long gcd(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);

		int amari=max%min;
		if(amari==0)return min;
		return gcd(min,amari);
	}

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

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static long gcd(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);

		int amari=max%min;
		if(amari==0)return min;
		return gcd(min,amari);
	}

	private static int lcm(long a,long b){
		return (int) (a*b/gcd((int)a,(int)b));
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static long gcd(int a,int b){
		int max=Math.max(a, b);
		int min=Math.min(a, b);

		int amari=max%min;
		if(amari==0)return min;
		return gcd(min,amari);
	}

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