import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		int a,b,k=1,t=1,x,y;
		int i=1,j=1;
		while(s.hasNext()){
			a=s.nextInt();
			b=s.nextInt();
			//
			k=a;t=b;
			while(true){
				if(k==t)
					break;
				if(k<t){
					k=a*i;
					i++;
				}
				if(t<k){
					t=b*j;
					j++;
				}
			}
			x=k;
			//
			i=1;j=1;k=a;t=b;
			while(true){
				if(k==t)
					break;
				if(t<k){
					i++;
					if(a%i==0){
					k=a/i;
					}
				}
				if(k<t){
					j++;
					if(b%j==0){
					t=b/j;
					}
				}
			}
			y=k;
			System.out.println(y+" "+x);
			i=1;j=1;k=1;t=1;
		}
	}
}
/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