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

public class Main {
	public static void main(String[] a) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> al = new ArrayList<String>();

		String str;
		// 1???????????\?????????????????????????????????
		while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		}

		int[][] gcdLcm = new int[al.size()][2];
		int len = al.size();

		for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		}

		//??????
		for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		}
	}

	// GCD????¨????
	private static int gcd(int m, int n) {
		return n == 0 ? m : gcd(n, m % n);
	}

	// LCM????¨????
	private static int lcm(long m, long n, long gcd) {
		return (int)(m * n / gcd);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util public class Main {
	public static void main(String[] a) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> al = new ArrayList<String>();

		String str;
		// 1???????????\?????????????????????????????????
		while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		}

		int[][] gcdLcm = new int[al.size()][2];
		int len = al.size();

		for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		}

		//??????
		for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		}
	}

	// GCD????¨????
	private static int gcd(int m, int n) {
		return n == 0 ? m : gcd(n, m % n);
	}

	// LCM????¨????
	private static int lcm(long m, long n, long gcd) {
		return (int)(m * n / gcd);
	}
} Main public static void main(String[] a) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> al = new ArrayList<String>();

		String str;
		// 1???????????\?????????????????????????????????
		while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		}

		int[][] gcdLcm = new int[al.size()][2];
		int len = al.size();

		for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		}

		//??????
		for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> al = new ArrayList<String>();

		String str;
		// 1???????????\?????????????????????????????????
		while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		}

		int[][] gcdLcm = new int[al.size()][2];
		int len = al.size();

		for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		}

		//??????
		for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) ArrayList<String> al = new ArrayList<String>(); al new ArrayList<String>() String str; str while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		} (str = br.readLine()) != null (str = br.readLine()) str br.readLine() br.readLine br null {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		} if (str.length() == 0) {
				break;
			} str.length() == 0 str.length() str.length str 0 {
				break;
			} break; al.add(str) al.add al str int[][] gcdLcm = new int[al.size()][2]; gcdLcm new int[al.size()][2] al.size() al.size al 2 int len = al.size(); len al.size() al.size al for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		} {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		} String[] buf = al.get(i).split(" "); buf al.get(i).split(" ") al.get(i).split al.get(i) al.get al i " " int m = Integer.parseInt(buf[0]); m Integer.parseInt(buf[0]) Integer.parseInt Integer buf[0] buf 0 int n = Integer.parseInt(buf[1]); n Integer.parseInt(buf[1]) Integer.parseInt Integer buf[1] buf 1 gcdLcm[i][0] = gcd(m, n) gcdLcm[i][0] gcdLcm[i] gcdLcm i 0 gcd(m, n) gcd m n gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]) gcdLcm[i][1] gcdLcm[i] gcdLcm i 1 lcm((long)m, (long)n, (long)gcdLcm[i][0]) lcm (long)m (long)n (long)gcdLcm[i][0] gcdLcm[i] gcdLcm i 0 for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		} int i=0; int i=0; i 0 i<gcdLcm.length i gcdLcm.length gcdLcm gcdLcm.length i++ i++ i {
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		} {
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		} System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]) System.out.println System.out System System.out gcdLcm[i][0]+" "+gcdLcm[i][1] gcdLcm[i][0]+" "+gcdLcm[i][1] gcdLcm[i][0] gcdLcm[i] gcdLcm i 0 " " gcdLcm[i][1] gcdLcm[i] gcdLcm i 1 String[] a a // GCD????¨????
	private static int gcd(int m, int n) {
		return n == 0 ? m : gcd(n, m % n);
	} gcd {
		return n == 0 ? m : gcd(n, m % n);
	} return n == 0 ? m : gcd(n, m % n); n == 0 ? m : gcd(n, m % n) n == 0 n 0 m gcd(n, m % n) gcd n m % n m n int m m int n n // LCM????¨????
	private static int lcm(long m, long n, long gcd) {
		return (int)(m * n / gcd);
	} lcm {
		return (int)(m * n / gcd);
	} return (int)(m * n / gcd); (int)(m * n / gcd) m * n m n gcd long m m long n n long gcd gcd public class Main {
	public static void main(String[] a) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> al = new ArrayList<String>();

		String str;
		// 1???????????\?????????????????????????????????
		while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		}

		int[][] gcdLcm = new int[al.size()][2];
		int len = al.size();

		for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		}

		//??????
		for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		}
	}

	// GCD????¨????
	private static int gcd(int m, int n) {
		return n == 0 ? m : gcd(n, m % n);
	}

	// LCM????¨????
	private static int lcm(long m, long n, long gcd) {
		return (int)(m * n / gcd);
	}
} public class Main {
	public static void main(String[] a) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> al = new ArrayList<String>();

		String str;
		// 1???????????\?????????????????????????????????
		while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		}

		int[][] gcdLcm = new int[al.size()][2];
		int len = al.size();

		for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		}

		//??????
		for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		}
	}

	// GCD????¨????
	private static int gcd(int m, int n) {
		return n == 0 ? m : gcd(n, m % n);
	}

	// LCM????¨????
	private static int lcm(long m, long n, long gcd) {
		return (int)(m * n / gcd);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
	public static void main(String[] a) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> al = new ArrayList<String>();

		String str;
		// 1???????????\?????????????????????????????????
		while ((str = br.readLine()) != null) {
			if (str.length() == 0) {
				break;
			}
			al.add(str);
		}

		int[][] gcdLcm = new int[al.size()][2];
		int len = al.size();

		for (int i = 0; i < len; i++) {
			String[] buf = al.get(i).split(" ");
			int m = Integer.parseInt(buf[0]);
			int n = Integer.parseInt(buf[1]);
			gcdLcm[i][0] = gcd(m, n);
			gcdLcm[i][1] = lcm((long)m, (long)n, (long)gcdLcm[i][0]);
		}

		//??????
		for(int i=0;i<gcdLcm.length;i++){
			System.out.println(gcdLcm[i][0]+" "+gcdLcm[i][1]);
		}
	}

	// GCD????¨????
	private static int gcd(int m, int n) {
		return n == 0 ? m : gcd(n, m % n);
	}

	// LCM????¨????
	private static int lcm(long m, long n, long gcd) {
		return (int)(m * n / gcd);
	}
}