import java.util.Scanner;
class Main {

    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {

            int A = scanner.nextInt();

            int B = scanner.nextInt();

            int max = getMAX(A, B);

            int min = getMIN(A, B, max);

            System.out.println(max + " " + min);



        }
    }

    private static int getMAX(int A, int B) {
        for (int i = A; A > 0; i--) {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        }
        return 1;
    }
    private static int getMIN(int A, int B, int max){
        return A/max*B;
    }
} import java.util.Scanner; Scanner java.util class Main {

    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {

            int A = scanner.nextInt();

            int B = scanner.nextInt();

            int max = getMAX(A, B);

            int min = getMIN(A, B, max);

            System.out.println(max + " " + min);



        }
    }

    private static int getMAX(int A, int B) {
        for (int i = A; A > 0; i--) {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        }
        return 1;
    }
    private static int getMIN(int A, int B, int max){
        return A/max*B;
    }
} Main public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {

            int A = scanner.nextInt();

            int B = scanner.nextInt();

            int max = getMAX(A, B);

            int min = getMIN(A, B, max);

            System.out.println(max + " " + min);



        }
    } main {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {

            int A = scanner.nextInt();

            int B = scanner.nextInt();

            int max = getMAX(A, B);

            int min = getMIN(A, B, max);

            System.out.println(max + " " + min);



        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (scanner.hasNext()) {

            int A = scanner.nextInt();

            int B = scanner.nextInt();

            int max = getMAX(A, B);

            int min = getMIN(A, B, max);

            System.out.println(max + " " + min);



        } scanner.hasNext() scanner.hasNext scanner {

            int A = scanner.nextInt();

            int B = scanner.nextInt();

            int max = getMAX(A, B);

            int min = getMIN(A, B, max);

            System.out.println(max + " " + min);



        } int A = scanner.nextInt(); A scanner.nextInt() scanner.nextInt scanner int B = scanner.nextInt(); B scanner.nextInt() scanner.nextInt scanner int max = getMAX(A, B); max getMAX(A, B) getMAX A B int min = getMIN(A, B, max); min getMIN(A, B, max) getMIN A B max System.out.println(max + " " + min) System.out.println System.out System System.out max + " " + min max + " " + min max " " min String args[] args private static int getMAX(int A, int B) {
        for (int i = A; A > 0; i--) {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        }
        return 1;
    } getMAX {
        for (int i = A; A > 0; i--) {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        }
        return 1;
    } for (int i = A; A > 0; i--) {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        } int i = A; int i = A; i A A > 0 A 0 i-- i-- i {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        } {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        } if (A % i == 0 && B % i == 0) {
                return i;
            } A % i == 0 && B % i == 0 A % i == 0 A % i A i 0 B % i == 0 B % i B i 0 {
                return i;
            } return i; i return 1; 1 int A A int B B private static int getMIN(int A, int B, int max){
        return A/max*B;
    } getMIN {
        return A/max*B;
    } return A/max*B; A/max*B A/max A max B int A A int B B int max max
import java.util.Scanner;
class Main {

    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {

            int A = scanner.nextInt();

            int B = scanner.nextInt();

            int max = getMAX(A, B);

            int min = getMIN(A, B, max);

            System.out.println(max + " " + min);



        }
    }

    private static int getMAX(int A, int B) {
        for (int i = A; A > 0; i--) {
            if (A % i == 0 && B % i == 0) {
                return i;
            }
        }
        return 1;
    }
    private static int getMIN(int A, int B, int max){
        return A/max*B;
    }
}
