import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str;
		long num[] = new long[2];
		while((str = in.readLine()) != null){
			num[0] = Long.parseLong(str.substring(0, str.indexOf(" ")));
			num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length()));
			System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));

		}

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

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str;
		long num[] = new long[2];
		while((str = in.readLine()) != null){
			num[0] = Long.parseLong(str.substring(0, str.indexOf(" ")));
			num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length()));
			System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));

		}

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

} Main public static void main(String args[]) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str;
		long num[] = new long[2];
		while((str = in.readLine()) != null){
			num[0] = Long.parseLong(str.substring(0, str.indexOf(" ")));
			num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length()));
			System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));

		}

	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str;
		long num[] = new long[2];
		while((str = in.readLine()) != null){
			num[0] = Long.parseLong(str.substring(0, str.indexOf(" ")));
			num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length()));
			System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));

		}

	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String str; str long num[] = new long[2]; num new long[2] 2 while((str = in.readLine()) != null){
			num[0] = Long.parseLong(str.substring(0, str.indexOf(" ")));
			num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length()));
			System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));

		} (str = in.readLine()) != null (str = in.readLine()) str in.readLine() in.readLine in null {
			num[0] = Long.parseLong(str.substring(0, str.indexOf(" ")));
			num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length()));
			System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));

		} num[0] = Long.parseLong(str.substring(0, str.indexOf(" "))) num[0] num 0 Long.parseLong(str.substring(0, str.indexOf(" "))) Long.parseLong Long str.substring(0, str.indexOf(" ")) str.substring str 0 str.indexOf(" ") str.indexOf str " " num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length())) num[1] num 1 Long.parseLong(str.substring(str.indexOf(" ")+1, str.length())) Long.parseLong Long str.substring(str.indexOf(" ")+1, str.length()) str.substring str str.indexOf(" ")+1 str.indexOf(" ") str.indexOf str " " 1 str.length() str.length str System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1])) System.out.println System.out System System.out gcd(num[0], num[1]) + " " + lcm(num[0], num[1]) gcd(num[0], num[1]) + " " + lcm(num[0], num[1]) gcd(num[0], num[1]) gcd num[0] num 0 num[1] num 1 " " lcm(num[0], num[1]) lcm num[0] num 0 num[1] num 1 String args[] args static long gcd(long a, long b){
		return b == 0 ? a : gcd(b, a%b);
	} gcd {
		return b == 0 ? a : gcd(b, a%b);
	} return b == 0 ? a : gcd(b, a%b); b == 0 ? a : gcd(b, a%b) b == 0 b 0 a gcd(b, a%b) gcd b a%b a b long a a long b b static long lcm(long a, long b){
		return b*a/gcd(a,b);
	} lcm {
		return b*a/gcd(a,b);
	} return b*a/gcd(a,b); b*a/gcd(a,b) b*a b a gcd(a,b) gcd a b long a a long b b
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str;
		long num[] = new long[2];
		while((str = in.readLine()) != null){
			num[0] = Long.parseLong(str.substring(0, str.indexOf(" ")));
			num[1] = Long.parseLong(str.substring(str.indexOf(" ")+1, str.length()));
			System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));

		}

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

}