import java.util.Scanner;

class Main {
    private static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        } else {
            return gcd(b, a % b);
        }
    }

    private static long lcm(long a, long b) {
        long gcd = gcd(a, b);
        return a * b / gcd;
    }

    private static void solve() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLong()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        }
    }

    public static void main(String... args) {
        solve();
    }
} import java.util.Scanner; Scanner java.util class Main {
    private static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        } else {
            return gcd(b, a % b);
        }
    }

    private static long lcm(long a, long b) {
        long gcd = gcd(a, b);
        return a * b / gcd;
    }

    private static void solve() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLong()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        }
    }

    public static void main(String... args) {
        solve();
    }
} Main private static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        } else {
            return gcd(b, a % b);
        }
    } gcd {
        if (a % b == 0) {
            return b;
        } else {
            return gcd(b, a % b);
        }
    } if (a % b == 0) {
            return b;
        } else {
            return gcd(b, a % b);
        } a % b == 0 a % b a b 0 {
            return b;
        } return b; b {
            return gcd(b, a % b);
        } return gcd(b, a % b); gcd(b, a % b) gcd b a % b a b long a a long b b private static long lcm(long a, long b) {
        long gcd = gcd(a, b);
        return a * b / gcd;
    } lcm {
        long gcd = gcd(a, b);
        return a * b / gcd;
    } long gcd = gcd(a, b); gcd gcd(a, b) gcd a b return a * b / gcd; a * b / gcd a * b a b gcd long a a long b b private static void solve() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLong()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        }
    } solve {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLong()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (scanner.hasNextLong()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        } scanner.hasNextLong() scanner.hasNextLong scanner {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        } long a = scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner long b = scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner System.out.println(gcd(a, b) + " " + lcm(a, b)) System.out.println System.out System System.out gcd(a, b) + " " + lcm(a, b) gcd(a, b) + " " + lcm(a, b) gcd(a, b) gcd a b " " lcm(a, b) lcm a b public static void main(String... args) {
        solve();
    } main {
        solve();
    } solve() solve String... args args
import java.util.Scanner;

class Main {
    private static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        } else {
            return gcd(b, a % b);
        }
    }

    private static long lcm(long a, long b) {
        long gcd = gcd(a, b);
        return a * b / gcd;
    }

    private static void solve() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLong()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        }
    }

    public static void main(String... args) {
        solve();
    }
}