import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
       
        while (scanner.hasNext()) {
            long x0 = scanner.nextLong();
            long y0 = scanner.nextLong();
            
            long x = x0;
            long y = y0;
            long gcd = 0;
            long lcm = 0;
            
            while (x != y) {
                if (y > x) {
                    long temp = y;
                    y = x;
                    x = temp;
                }
                x = x - y; 
            }
            gcd = x;         
            lcm = x0 * y0 /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