import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        }

    }
    public static int gcd(int m, int n) {
        if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        }
    }

    public static int lcm(int m, int n) {
        return m / gcd(m, n) * n;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        }

    }
    public static int gcd(int m, int n) {
        if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        }
    }

    public static int lcm(int m, int n) {
        return m / gcd(m, n) * n;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        }

    } main {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        } sc.hasNext() sc.hasNext sc {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        } int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc System.out.printf("%d %d\n", gcd(m, n), lcm(m, n)) System.out.printf System.out System System.out "%d %d\n" gcd(m, n) gcd m n lcm(m, n) lcm m n String[] args args public static int gcd(int m, int n) {
        if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        }
    } gcd {
        if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        }
    } if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        } m % n == 0 m % n m n 0 {
            return n;
        } return n; n {
            return gcd(n, m % n);
        } return gcd(n, m % n); gcd(n, m % n) gcd n m % n m n int m m int n n public static int lcm(int m, int n) {
        return m / gcd(m, n) * n;
    } lcm {
        return m / gcd(m, n) * n;
    } return m / gcd(m, n) * n; m / gcd(m, n) * n m / gcd(m, n) m gcd(m, n) gcd m n n int m m int n n public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        }

    }
    public static int gcd(int m, int n) {
        if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        }
    }

    public static int lcm(int m, int n) {
        return m / gcd(m, n) * n;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        }

    }
    public static int gcd(int m, int n) {
        if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        }
    }

    public static int lcm(int m, int n) {
        return m / gcd(m, n) * n;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            int n = sc.nextInt();
            System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
        }

    }
    public static int gcd(int m, int n) {
        if (m % n == 0) {
            return n;
        } else {
            return gcd(n, m % n);
        }
    }

    public static int lcm(int m, int n) {
        return m / gcd(m, n) * n;
    }
}
