import java.util.Scanner;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.lang.Math;

class Main{
    public static void main(String[] args){
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(inputStreamReader);
        
        String str;
        int[] num;
        
        try {
            while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    // ----- 自作関数 ----- //

    private static int gcd(int a, int b){
        if (a < b) {
            int buff = a;
            a = b;
            b = buff;
        }

        if (b == 0) {
            return a;
        }
        else{
            return gcd(b, a%b);
        }
    }

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

    private static int[] getNum(String str){
        String[] data = str.split(" "); 
        int[] num = new int[data.length];

        for (int i = 0; i < data.length; i++){
            num[i] = Integer.parseInt(data[i]);
        }
        return num;
    }
} import java.util.Scanner; Scanner java.util import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.lang.Math; Math java.lang class Main{
    public static void main(String[] args){
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(inputStreamReader);
        
        String str;
        int[] num;
        
        try {
            while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    // ----- 自作関数 ----- //

    private static int gcd(int a, int b){
        if (a < b) {
            int buff = a;
            a = b;
            b = buff;
        }

        if (b == 0) {
            return a;
        }
        else{
            return gcd(b, a%b);
        }
    }

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

    private static int[] getNum(String str){
        String[] data = str.split(" "); 
        int[] num = new int[data.length];

        for (int i = 0; i < data.length; i++){
            num[i] = Integer.parseInt(data[i]);
        }
        return num;
    }
} Main public static void main(String[] args){
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(inputStreamReader);
        
        String str;
        int[] num;
        
        try {
            while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    } main {
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(inputStreamReader);
        
        String str;
        int[] num;
        
        try {
            while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    } InputStreamReader inputStreamReader = new InputStreamReader(System.in); inputStreamReader new InputStreamReader(System.in) BufferedReader reader = new BufferedReader(inputStreamReader); reader new BufferedReader(inputStreamReader) String str; str int[] num; num try {
            while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            }
            reader.close();
        } while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            } reader.ready() reader.ready reader {
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            } str = reader.readLine() str reader.readLine() reader.readLine reader num = getNum(str) num getNum(str) getNum str System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1])) System.out.println System.out System System.out gcd(num[0], num[1]) + " " + lcm(num[0], num[1]) gcd(num[0], num[1]) + " " + lcm(num[0], num[1]) gcd(num[0], num[1]) gcd num[0] num 0 num[1] num 1 " " lcm(num[0], num[1]) lcm num[0] num 0 num[1] num 1 reader.close() reader.close reader String[] args args private static int gcd(int a, int b){
        if (a < b) {
            int buff = a;
            a = b;
            b = buff;
        }

        if (b == 0) {
            return a;
        }
        else{
            return gcd(b, a%b);
        }
    } gcd {
        if (a < b) {
            int buff = a;
            a = b;
            b = buff;
        }

        if (b == 0) {
            return a;
        }
        else{
            return gcd(b, a%b);
        }
    } if (a < b) {
            int buff = a;
            a = b;
            b = buff;
        } a < b a b {
            int buff = a;
            a = b;
            b = buff;
        } int buff = a; buff a a = b a b b = buff b buff if (b == 0) {
            return a;
        }
        else{
            return gcd(b, a%b);
        } b == 0 b 0 {
            return a;
        } return a; a {
            return gcd(b, a%b);
        } return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b int a a int b b private static int lcm(int a, int b) {
        return (int) (((long)a * b) / gcd(a, b));
    } lcm {
        return (int) (((long)a * b) / gcd(a, b));
    } return (int) (((long)a * b) / gcd(a, b)); (int) (((long)a * b) / gcd(a, b)) ((long)a * b) (long)a b gcd(a, b) gcd a b int a a int b b private static int[] getNum(String str){
        String[] data = str.split(" "); 
        int[] num = new int[data.length];

        for (int i = 0; i < data.length; i++){
            num[i] = Integer.parseInt(data[i]);
        }
        return num;
    } getNum {
        String[] data = str.split(" "); 
        int[] num = new int[data.length];

        for (int i = 0; i < data.length; i++){
            num[i] = Integer.parseInt(data[i]);
        }
        return num;
    } String[] data = str.split(" "); data str.split(" ") str.split str " " int[] num = new int[data.length]; num new int[data.length] data.length data data.length for (int i = 0; i < data.length; i++){
            num[i] = Integer.parseInt(data[i]);
        } int i = 0; int i = 0; i 0 i < data.length i data.length data data.length i++ i++ i {
            num[i] = Integer.parseInt(data[i]);
        } {
            num[i] = Integer.parseInt(data[i]);
        } num[i] = Integer.parseInt(data[i]) num[i] num i Integer.parseInt(data[i]) Integer.parseInt Integer data[i] data i return num; num String str str
import java.util.Scanner;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.lang.Math;

class Main{
    public static void main(String[] args){
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(inputStreamReader);
        
        String str;
        int[] num;
        
        try {
            while(reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    // ----- 自作関数 ----- //

    private static int gcd(int a, int b){
        if (a < b) {
            int buff = a;
            a = b;
            b = buff;
        }

        if (b == 0) {
            return a;
        }
        else{
            return gcd(b, a%b);
        }
    }

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

    private static int[] getNum(String str){
        String[] data = str.split(" "); 
        int[] num = new int[data.length];

        for (int i = 0; i < data.length; i++){
            num[i] = Integer.parseInt(data[i]);
        }
        return num;
    }
}
