import static java.lang.System.out;
import static java.lang.Long.parseLong;
import java.io.File;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        new Main().printGCDLCM();
    }

    public void printGCDLCM() {
        try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    }

    public void printGCDLCM(String inputDataPath) {
        try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void gcdLCM(Scanner scan) {
        String inputData;
        while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        }
    }

    private long[] getData(String inputData) {
        String[] dataSplit = inputData.split(" ");
        long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) };
        return data;
    }

    private long lcm(long[] data) {
        return (data[0] * data[1]) / gcd(data);
    }

    private long gcd(long[] data) {
        long[] tmpData = changeAB(data).clone();
        long mod = -1;
        while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        }
        return tmpData[1];
    }

    private long[] changeAB(long[] data) {
        if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        }
        return data;
    }
} import static java.lang.System.out; import static java.lang.System.out; import static java.lang.System.out; import static java.lang.Long.parseLong; import static java.lang.Long.parseLong; import static java.lang.Long.parseLong; import java.io.File; File java.io import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        new Main().printGCDLCM();
    }

    public void printGCDLCM() {
        try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    }

    public void printGCDLCM(String inputDataPath) {
        try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void gcdLCM(Scanner scan) {
        String inputData;
        while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        }
    }

    private long[] getData(String inputData) {
        String[] dataSplit = inputData.split(" ");
        long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) };
        return data;
    }

    private long lcm(long[] data) {
        return (data[0] * data[1]) / gcd(data);
    }

    private long gcd(long[] data) {
        long[] tmpData = changeAB(data).clone();
        long mod = -1;
        while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        }
        return tmpData[1];
    }

    private long[] changeAB(long[] data) {
        if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        }
        return data;
    }
} Main public static void main(String[] args) {
        new Main().printGCDLCM();
    } main {
        new Main().printGCDLCM();
    } new Main().printGCDLCM() new Main().printGCDLCM new Main() String[] args args public void printGCDLCM() {
        try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    } printGCDLCM {
        try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    } try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        } catch (Exception e) {
            System.exit(0);
        } Exception e {
            System.exit(0);
        } System.exit(0) System.exit System 0 {
            gcdLCM(scan);
        } Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) gcdLCM(scan) gcdLCM scan public void printGCDLCM(String inputDataPath) {
        try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    } printGCDLCM {
        try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    } try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            gcdLCM(scan);
        } Scanner scan = new Scanner(new File(inputDataPath)) Scanner scan = new Scanner(new File(inputDataPath)) new Scanner(new File(inputDataPath)) gcdLCM(scan) gcdLCM scan String inputDataPath inputDataPath public void gcdLCM(Scanner scan) {
        String inputData;
        while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        }
    } gcdLCM {
        String inputData;
        while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        }
    } String inputData; inputData while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        } (inputData = scan.nextLine()) != null && !"".equals(inputData) (inputData = scan.nextLine()) != null (inputData = scan.nextLine()) inputData scan.nextLine() scan.nextLine scan null !"".equals(inputData) "".equals(inputData) "".equals "" inputData {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        } long[] data = getData(inputData); data getData(inputData) getData inputData out.println(gcd(data) + " " + lcm(data)) out.println out gcd(data) + " " + lcm(data) gcd(data) + " " + lcm(data) gcd(data) gcd data " " lcm(data) lcm data Scanner scan scan private long[] getData(String inputData) {
        String[] dataSplit = inputData.split(" ");
        long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) };
        return data;
    } getData {
        String[] dataSplit = inputData.split(" ");
        long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) };
        return data;
    } String[] dataSplit = inputData.split(" "); dataSplit inputData.split(" ") inputData.split inputData " " long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) }; data { parseLong(dataSplit[0]), parseLong(dataSplit[1]) } parseLong(dataSplit[0]) parseLong dataSplit[0] dataSplit 0 parseLong(dataSplit[1]) parseLong dataSplit[1] dataSplit 1 return data; data String inputData inputData private long lcm(long[] data) {
        return (data[0] * data[1]) / gcd(data);
    } lcm {
        return (data[0] * data[1]) / gcd(data);
    } return (data[0] * data[1]) / gcd(data); (data[0] * data[1]) / gcd(data) (data[0] * data[1]) data[0] data 0 data[1] data 1 gcd(data) gcd data long[] data data private long gcd(long[] data) {
        long[] tmpData = changeAB(data).clone();
        long mod = -1;
        while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        }
        return tmpData[1];
    } gcd {
        long[] tmpData = changeAB(data).clone();
        long mod = -1;
        while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        }
        return tmpData[1];
    } long[] tmpData = changeAB(data).clone(); tmpData changeAB(data).clone() changeAB(data).clone changeAB(data) changeAB data long mod = -1; mod -1 1 while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        } (mod = tmpData[0] % tmpData[1]) != 0 (mod = tmpData[0] % tmpData[1]) mod tmpData[0] % tmpData[1] tmpData[0] tmpData 0 tmpData[1] tmpData 1 0 {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        } tmpData[0] = tmpData[1] tmpData[0] tmpData 0 tmpData[1] tmpData 1 tmpData[1] = mod tmpData[1] tmpData 1 mod return tmpData[1]; tmpData[1] tmpData 1 long[] data data private long[] changeAB(long[] data) {
        if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        }
        return data;
    } changeAB {
        if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        }
        return data;
    } if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        } data[0] < data[1] data[0] data 0 data[1] data 1 {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        } long tmp = data[0]; tmp data[0] data 0 data[0] = data[1] data[0] data 0 data[1] data 1 data[1] = tmp data[1] data 1 tmp return data; data long[] data data public class Main {

    public static void main(String[] args) {
        new Main().printGCDLCM();
    }

    public void printGCDLCM() {
        try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    }

    public void printGCDLCM(String inputDataPath) {
        try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void gcdLCM(Scanner scan) {
        String inputData;
        while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        }
    }

    private long[] getData(String inputData) {
        String[] dataSplit = inputData.split(" ");
        long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) };
        return data;
    }

    private long lcm(long[] data) {
        return (data[0] * data[1]) / gcd(data);
    }

    private long gcd(long[] data) {
        long[] tmpData = changeAB(data).clone();
        long mod = -1;
        while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        }
        return tmpData[1];
    }

    private long[] changeAB(long[] data) {
        if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        }
        return data;
    }
} public class Main {

    public static void main(String[] args) {
        new Main().printGCDLCM();
    }

    public void printGCDLCM() {
        try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    }

    public void printGCDLCM(String inputDataPath) {
        try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void gcdLCM(Scanner scan) {
        String inputData;
        while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        }
    }

    private long[] getData(String inputData) {
        String[] dataSplit = inputData.split(" ");
        long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) };
        return data;
    }

    private long lcm(long[] data) {
        return (data[0] * data[1]) / gcd(data);
    }

    private long gcd(long[] data) {
        long[] tmpData = changeAB(data).clone();
        long mod = -1;
        while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        }
        return tmpData[1];
    }

    private long[] changeAB(long[] data) {
        if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        }
        return data;
    }
} Main
import static java.lang.System.out;
import static java.lang.Long.parseLong;
import java.io.File;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        new Main().printGCDLCM();
    }

    public void printGCDLCM() {
        try (Scanner scan = new Scanner(System.in)) {
            gcdLCM(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    }

    public void printGCDLCM(String inputDataPath) {
        try (Scanner scan = new Scanner(new File(inputDataPath))) {
            gcdLCM(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void gcdLCM(Scanner scan) {
        String inputData;
        while ((inputData = scan.nextLine()) != null && !"".equals(inputData)) {
            long[] data = getData(inputData);
            out.println(gcd(data) + " " + lcm(data));
        }
    }

    private long[] getData(String inputData) {
        String[] dataSplit = inputData.split(" ");
        long[] data = { parseLong(dataSplit[0]), parseLong(dataSplit[1]) };
        return data;
    }

    private long lcm(long[] data) {
        return (data[0] * data[1]) / gcd(data);
    }

    private long gcd(long[] data) {
        long[] tmpData = changeAB(data).clone();
        long mod = -1;
        while ((mod = tmpData[0] % tmpData[1]) != 0) {
            tmpData[0] = tmpData[1];
            tmpData[1] = mod;
        }
        return tmpData[1];
    }

    private long[] changeAB(long[] data) {
        if (data[0] < data[1]) {
            long tmp = data[0];
            data[0] = data[1];
            data[1] = tmp;
        }
        return data;
    }
}