import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.IntStream;


public class Main {
    private static int gcd(int a, int b)
    {
        while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

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


    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in));

        String line;
        int rows, cols;
        int two, three, a, b;
        double rate;
        boolean checker;
        double count;
        while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        }


    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java import java.util.stream.IntStream; IntStream java.util.stream public class Main {
    private static int gcd(int a, int b)
    {
        while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

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


    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in));

        String line;
        int rows, cols;
        int two, three, a, b;
        double rate;
        boolean checker;
        double count;
        while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        }


    }
} Main private static int gcd(int a, int b)
    {
        while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    } gcd {
        while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    } while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        } b > 0 b 0 {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        } int temp = b; temp b b = a % b b a % b a b a = temp a temp return a; a int a a int b b private static int lcm(int a, int b)
    {
        return a * (b / gcd(a, b));
    } lcm {
        return a * (b / gcd(a, b));
    } return a * (b / gcd(a, b)); a * (b / gcd(a, b)) a (b / gcd(a, b)) b gcd(a, b) gcd a b int a a int b b public static void main(String[] args) throws java.lang.Exception {
        BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in));

        String line;
        int rows, cols;
        int two, three, a, b;
        double rate;
        boolean checker;
        double count;
        while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        }


    } main {
        BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in));

        String line;
        int rows, cols;
        int two, three, a, b;
        double rate;
        boolean checker;
        double count;
        while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        }


    } BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String line; line int rows rows cols; cols int two two three three a a b; b double rate; rate boolean checker; checker double count; count while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        } (line = in.readLine()) != null && !(line.equals("")) (line = in.readLine()) != null (line = in.readLine()) line in.readLine() in.readLine in null !(line.equals("")) (line.equals("")) line.equals line "" {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        } String [] temp = line.split(" "); temp line.split(" ") line.split line " " a = Integer.parseInt(temp[0]) a Integer.parseInt(temp[0]) Integer.parseInt Integer temp[0] temp 0 b = Integer.parseInt(temp[1]) b Integer.parseInt(temp[1]) Integer.parseInt Integer temp[1] temp 1 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 String[] args args public class Main {
    private static int gcd(int a, int b)
    {
        while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

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


    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in));

        String line;
        int rows, cols;
        int two, three, a, b;
        double rate;
        boolean checker;
        double count;
        while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        }


    }
} public class Main {
    private static int gcd(int a, int b)
    {
        while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

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


    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in));

        String line;
        int rows, cols;
        int two, three, a, b;
        double rate;
        boolean checker;
        double count;
        while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        }


    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.IntStream;


public class Main {
    private static int gcd(int a, int b)
    {
        while (b > 0)
        {
            int temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

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


    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader in
                = new BufferedReader(new InputStreamReader(System.in));

        String line;
        int rows, cols;
        int two, three, a, b;
        double rate;
        boolean checker;
        double count;
        while ((line = in.readLine()) != null && !(line.equals(""))) {
                String [] temp = line.split(" ");
                a = Integer.parseInt(temp[0]);
                b = Integer.parseInt(temp[1]);

                System.out.println(gcd(a, b) + " " +lcm(a, b));

        }


    }
}