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

public class Main {

	/** ??\??????????????°????????° */
	private static final int NUMBER_OF_INPUT = 2;

	/** ??\??????????????°????????????????????????????°???? */
	private static final int INDEX_LITTLE = 0;

	/** ??\??????????????°?????????????????????????????§??? */
	private static final int INDEX_GREAT = 1;

	/**
	 * ??????????????????2????????°???????????????????????????2????????°??????????¨????????????°??????????????????
	 *
	 * @param args
	 */
	public static void main(String[] args) throws IOException {

		// ??\?????????????????????????????????
		String line = null;
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		while ((line = reader.readLine()) != null) {

			// ??\?????????????????°????????????????????????
			int[] input = convertStringToIntArray(line);

			// ????¨????????????°???????????????
			Arrays.sort(input);
			int greatestCommonDivisor = calculateGreatestCommonDivisor(input);
			int leastCommonMultiplyer = calculateLeastCommonMultiplyer(input, greatestCommonDivisor);

			// ?????????????????????
			System.out.print(greatestCommonDivisor);
			System.out.print(" ");
			System.out.println(leastCommonMultiplyer);
		}

		if (reader != null) {
			reader.close();
		}
	}

	/**
	 * ????????????????????°????????????????????´??°???????????¨???????????´?????????
	 *
	 * @param line
	 *            ????????????????????°????????????
	 * @return ??´??°?????????
	 */
	protected static int[] convertStringToIntArray(String line) {
		int[] result = new int[NUMBER_OF_INPUT];

		String[] splittedLine = line.split(" ");
		for (int i = 0; i < splittedLine.length; i++) {
			result[i] = Integer.parseInt(splittedLine[i]);
		}

		return result;
	}

	/**
	 * ?????°??§??????????????´??°??????????????§??¬?´???°????????????
	 *
	 * @param input
	 *            ??´??°?????????
	 * @return ?????§??¬?´???°
	 */
	protected static int calculateGreatestCommonDivisor(int[] input) {

		// ??????????????????????????????
		int greater = input[INDEX_GREAT];
		int less = input[INDEX_LITTLE];
		int divisor = greater - less;

		while (divisor != 0) {

			// ??§?????????????????? greater ???????°??????????????????? less ????¨??????????
			if (less >= divisor) {
				greater = less;
				less = divisor;
			} else {
				greater = divisor;
			}
			divisor = greater - less;
		}

		// ??????????????¨????????????????????§??¬?´???°
		return less;
	}

	/**
	 * ?????°??§??????????????´??°????????¨?????§??¬?´???°??????????°???¬?????°????????????
	 *
	 * @param input
	 *            ??´??°?????????
	 * @param greatestCommonDivisor
	 * 			  ?????§??¬?´???°
	 *
	 * @return ????°???¬?????°
	 */
	protected static int calculateLeastCommonMultiplyer(int[] input, int greatestCommonDivisor) {

		// ????°???¬?????° = ??\??????A ?? ??\??????B / ?????§??¬?´???°
		// ??????????????? int ??????????????????????????????????????????????????????????????¨ int ?????????????¶???????????????§?????????
		int leastCommonMultiplyer = input[INDEX_LITTLE] * (input[INDEX_GREAT]
				/ greatestCommonDivisor);
		return leastCommonMultiplyer;

	}

}
/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