import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main (String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");

        int a, b, r, temp;
        long gcd;

        while (sc.hasNextInt()) {
            a = sc.nextInt();
            b = sc.nextInt();

            gcd = (long) a * (long) b;

            if (a < b) {
                temp = a;
                a = b;
                b = temp;
            }

            do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0);

            gcd /= a;

            sb.append(a);
            sb.append(' ');
            sb.append(gcd);
            sb.append('\n');
        }

        System.out.print(sb);

    }
} import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util class Main {
    public static void main (String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");

        int a, b, r, temp;
        long gcd;

        while (sc.hasNextInt()) {
            a = sc.nextInt();
            b = sc.nextInt();

            gcd = (long) a * (long) b;

            if (a < b) {
                temp = a;
                a = b;
                b = temp;
            }

            do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0);

            gcd /= a;

            sb.append(a);
            sb.append(' ');
            sb.append(gcd);
            sb.append('\n');
        }

        System.out.print(sb);

    }
} Main public static void main (String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");

        int a, b, r, temp;
        long gcd;

        while (sc.hasNextInt()) {
            a = sc.nextInt();
            b = sc.nextInt();

            gcd = (long) a * (long) b;

            if (a < b) {
                temp = a;
                a = b;
                b = temp;
            }

            do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0);

            gcd /= a;

            sb.append(a);
            sb.append(' ');
            sb.append(gcd);
            sb.append('\n');
        }

        System.out.print(sb);

    } main {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");

        int a, b, r, temp;
        long gcd;

        while (sc.hasNextInt()) {
            a = sc.nextInt();
            b = sc.nextInt();

            gcd = (long) a * (long) b;

            if (a < b) {
                temp = a;
                a = b;
                b = temp;
            }

            do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0);

            gcd /= a;

            sb.append(a);
            sb.append(' ');
            sb.append(gcd);
            sb.append('\n');
        }

        System.out.print(sb);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(""); sb new StringBuilder("") int a a b b r r temp; temp long gcd; gcd while (sc.hasNextInt()) {
            a = sc.nextInt();
            b = sc.nextInt();

            gcd = (long) a * (long) b;

            if (a < b) {
                temp = a;
                a = b;
                b = temp;
            }

            do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0);

            gcd /= a;

            sb.append(a);
            sb.append(' ');
            sb.append(gcd);
            sb.append('\n');
        } sc.hasNextInt() sc.hasNextInt sc {
            a = sc.nextInt();
            b = sc.nextInt();

            gcd = (long) a * (long) b;

            if (a < b) {
                temp = a;
                a = b;
                b = temp;
            }

            do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0);

            gcd /= a;

            sb.append(a);
            sb.append(' ');
            sb.append(gcd);
            sb.append('\n');
        } a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc gcd = (long) a * (long) b gcd (long) a * (long) b (long) a (long) b if (a < b) {
                temp = a;
                a = b;
                b = temp;
            } a < b a b {
                temp = a;
                a = b;
                b = temp;
            } temp = a temp a a = b a b b = temp b temp do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0); b != 0 b 0 {
                r = a % b;
                a = b;
                b = r;
            } r = a % b r a % b a b a = b a b b = r b r gcd /= a gcd a sb.append(a) sb.append sb a sb.append(' ') sb.append sb ' ' sb.append(gcd) sb.append sb gcd sb.append('\n') sb.append sb '\n' System.out.print(sb) System.out.print System.out System System.out sb String[] args args
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main (String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");

        int a, b, r, temp;
        long gcd;

        while (sc.hasNextInt()) {
            a = sc.nextInt();
            b = sc.nextInt();

            gcd = (long) a * (long) b;

            if (a < b) {
                temp = a;
                a = b;
                b = temp;
            }

            do {
                r = a % b;
                a = b;
                b = r;
            } while (b != 0);

            gcd /= a;

            sb.append(a);
            sb.append(' ');
            sb.append(gcd);
            sb.append('\n');
        }

        System.out.print(sb);

    }
}