
import java.util.Scanner;

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

	public Main() {
		Scanner sc = new Scanner(System.in);
		String str = "";
	
		while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		}
	}

	public void solve(int a, int b) {
		int gcdRes = gcd(a, b);
		int lcmRes = lcm(a, b, gcdRes);
		
		System.out.println(gcdRes + " " + lcmRes);
	}
	
	private int gcd(int a, int b){
		if(a%b == 0)
			return b;
		
		return gcd(b, a%b);
	}
	
	private int lcm(int a, int b, int gcdNum){
		return (int)(((long)a*b) / gcdNum);
	}
	
	/** バグがある? **/
	private int lcm(int a, int b){
		if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		}

		int r = b;
		for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		}
		return r*a;
		
	}
	

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

	public Main() {
		Scanner sc = new Scanner(System.in);
		String str = "";
	
		while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		}
	}

	public void solve(int a, int b) {
		int gcdRes = gcd(a, b);
		int lcmRes = lcm(a, b, gcdRes);
		
		System.out.println(gcdRes + " " + lcmRes);
	}
	
	private int gcd(int a, int b){
		if(a%b == 0)
			return b;
		
		return gcd(b, a%b);
	}
	
	private int lcm(int a, int b, int gcdNum){
		return (int)(((long)a*b) / gcdNum);
	}
	
	/** バグがある? **/
	private int lcm(int a, int b){
		if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		}

		int r = b;
		for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		}
		return r*a;
		
	}
	

} Main public static void main(String[] args) {
		Main p = new Main();
	} main {
		Main p = new Main();
	} Main p = new Main(); p new Main() String[] args args public Main() {
		Scanner sc = new Scanner(System.in);
		String str = "";
	
		while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		}
	} Main {
		Scanner sc = new Scanner(System.in);
		String str = "";
	
		while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = ""; str "" while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		} sc.hasNextLine() sc.hasNextLine sc {
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		} str = sc.nextLine() str sc.nextLine() sc.nextLine sc String[] numStrs = str.split(" "); numStrs str.split(" ") str.split str " " int a = Integer.parseInt(numStrs[0]); a Integer.parseInt(numStrs[0]) Integer.parseInt Integer numStrs[0] numStrs 0 int b = Integer.parseInt(numStrs[1]); b Integer.parseInt(numStrs[1]) Integer.parseInt Integer numStrs[1] numStrs 1 if(b>a){
				int w = a;
				a = b;
				b = w;
			} b>a b a {
				int w = a;
				a = b;
				b = w;
			} int w = a; w a a = b a b b = w b w solve(a, b) solve a b public void solve(int a, int b) {
		int gcdRes = gcd(a, b);
		int lcmRes = lcm(a, b, gcdRes);
		
		System.out.println(gcdRes + " " + lcmRes);
	} solve {
		int gcdRes = gcd(a, b);
		int lcmRes = lcm(a, b, gcdRes);
		
		System.out.println(gcdRes + " " + lcmRes);
	} int gcdRes = gcd(a, b); gcdRes gcd(a, b) gcd a b int lcmRes = lcm(a, b, gcdRes); lcmRes lcm(a, b, gcdRes) lcm a b gcdRes System.out.println(gcdRes + " " + lcmRes) System.out.println System.out System System.out gcdRes + " " + lcmRes gcdRes + " " + lcmRes gcdRes " " lcmRes int a a int b b private int gcd(int a, int b){
		if(a%b == 0)
			return b;
		
		return gcd(b, a%b);
	} gcd {
		if(a%b == 0)
			return b;
		
		return gcd(b, a%b);
	} if(a%b == 0)
			return b; a%b == 0 a%b a b 0 return b; b return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b int a a int b b private int lcm(int a, int b, int gcdNum){
		return (int)(((long)a*b) / gcdNum);
	} lcm {
		return (int)(((long)a*b) / gcdNum);
	} return (int)(((long)a*b) / gcdNum); (int)(((long)a*b) / gcdNum) ((long)a*b) (long)a b gcdNum int a a int b b int gcdNum gcdNum /** バグがある? **/
	private int lcm(int a, int b){
		if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		}

		int r = b;
		for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		}
		return r*a;
		
	} lcm {
		if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		}

		int r = b;
		for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		}
		return r*a;
		
	} if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		} a<=3 a 3 {
			if(a==b)
				return a;
			else
				return a*b;
		} if(a==b)
				return a;
			else
				return a*b; a==b a b return a; a return a*b; a*b a b if(a%b==0){
			return a;
		} a%b==0 a%b a b 0 {
			return a;
		} return a; a int r = b; r b for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		} int i=2; int i=2; i 2 i*i<=a i*i i i a i++ i++ i {
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		} {
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		} int aFact = 1; aFact 1 while(a%i==0){
				a = a/i;
				aFact*=i;
			} a%i==0 a%i a i 0 {
				a = a/i;
				aFact*=i;
			} a = a/i a a/i a i aFact*=i aFact i int bFact = 1; bFact 1 while(b%i==0){
				b = b/i;
				bFact*=i;
			} b%i==0 b%i b i 0 {
				b = b/i;
				bFact*=i;
			} b = b/i b b/i b i bFact*=i bFact i if(aFact>bFact)
				r *= (aFact/bFact); aFact>bFact aFact bFact r *= (aFact/bFact) r (aFact/bFact) aFact bFact return r*a; r*a r a int a a int b b public class Main {
	public static void main(String[] args) {
		Main p = new Main();
	}

	public Main() {
		Scanner sc = new Scanner(System.in);
		String str = "";
	
		while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		}
	}

	public void solve(int a, int b) {
		int gcdRes = gcd(a, b);
		int lcmRes = lcm(a, b, gcdRes);
		
		System.out.println(gcdRes + " " + lcmRes);
	}
	
	private int gcd(int a, int b){
		if(a%b == 0)
			return b;
		
		return gcd(b, a%b);
	}
	
	private int lcm(int a, int b, int gcdNum){
		return (int)(((long)a*b) / gcdNum);
	}
	
	/** バグがある? **/
	private int lcm(int a, int b){
		if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		}

		int r = b;
		for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		}
		return r*a;
		
	}
	

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

	public Main() {
		Scanner sc = new Scanner(System.in);
		String str = "";
	
		while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		}
	}

	public void solve(int a, int b) {
		int gcdRes = gcd(a, b);
		int lcmRes = lcm(a, b, gcdRes);
		
		System.out.println(gcdRes + " " + lcmRes);
	}
	
	private int gcd(int a, int b){
		if(a%b == 0)
			return b;
		
		return gcd(b, a%b);
	}
	
	private int lcm(int a, int b, int gcdNum){
		return (int)(((long)a*b) / gcdNum);
	}
	
	/** バグがある? **/
	private int lcm(int a, int b){
		if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		}

		int r = b;
		for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		}
		return r*a;
		
	}
	

} Main

import java.util.Scanner;

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

	public Main() {
		Scanner sc = new Scanner(System.in);
		String str = "";
	
		while(sc.hasNextLine()){
			str = sc.nextLine();
			String[] numStrs = str.split(" ");
			int a = Integer.parseInt(numStrs[0]);
			int b = Integer.parseInt(numStrs[1]);
			if(b>a){
				int w = a;
				a = b;
				b = w;
			}
			solve(a, b);
		}
	}

	public void solve(int a, int b) {
		int gcdRes = gcd(a, b);
		int lcmRes = lcm(a, b, gcdRes);
		
		System.out.println(gcdRes + " " + lcmRes);
	}
	
	private int gcd(int a, int b){
		if(a%b == 0)
			return b;
		
		return gcd(b, a%b);
	}
	
	private int lcm(int a, int b, int gcdNum){
		return (int)(((long)a*b) / gcdNum);
	}
	
	/** バグがある? **/
	private int lcm(int a, int b){
		if(a<=3){
			if(a==b)
				return a;
			else
				return a*b;
		}else if(a%b==0){
			return a;
		}

		int r = b;
		for(int i=2;i*i<=a;i++){
			int aFact = 1;
			while(a%i==0){
				a = a/i;
				aFact*=i;
			}
			
			int bFact = 1;
			while(b%i==0){
				b = b/i;
				bFact*=i;
			}
			
			if(aFact>bFact)
				r *= (aFact/bFact);
		}
		return r*a;
		
	}
	

}