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);
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz