import java.util.Scanner;

public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;

	private void mainrun() {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	}

}

/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