import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
	while(kbd.hasNext()){
	    long a = kbd.nextLong();
	    long b = kbd.nextLong();
	    //  a<bにしておく
	    if(a>b) {
		long w = a;
		a = b; 
		b = w;
	    }

	    long gcd = a;

	    while(a%gcd!=0 || b%gcd!=0) {
		gcd = gcd-2;
		if(gcd==0) gcd = 1;
	    }

	    long lcm = a*b/gcd;

	    System.out.println(gcd+" "+lcm);
	}
    }
}
/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