
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input;
        try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input;
        try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} Main public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input;
        try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input;
        try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String input; input try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            } (input = reader.readLine()) != null (input = reader.readLine()) input reader.readLine() reader.readLine reader null {
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            } String[] inputArray = input.split(" "); inputArray input.split(" ") input.split input " " int a = Integer.parseInt(inputArray[0]); a Integer.parseInt(inputArray[0]) Integer.parseInt Integer inputArray[0] inputArray 0 int b = Integer.parseInt(inputArray[1]); b Integer.parseInt(inputArray[1]) Integer.parseInt Integer inputArray[1] inputArray 1 int aa = a; aa a int bb = b; bb b if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                } bb>aa bb aa {
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                } int tmp = aa; tmp aa aa = bb aa bb bb = tmp bb tmp int mod = aa % bb; mod aa % bb aa bb while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                } mod != 0 mod 0 {
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                } aa = bb aa bb bb = mod bb mod mod = aa % bb mod aa % bb aa bb System.out.println(bb+" "+(a/bb*b)) System.out.println System.out System System.out bb+" "+(a/bb*b) bb+" "+(a/bb*b) bb " " (a/bb*b) a/bb a bb b String[] args args public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input;
        try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input;
        try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input;
        try {
            while((input = reader.readLine()) != null){
                String[] inputArray = input.split(" ");
                int a = Integer.parseInt(inputArray[0]);
                int b = Integer.parseInt(inputArray[1]);
                int aa = a;
                int bb = b;
                if(bb>aa){
                    int tmp = aa;
                    aa = bb;
                    bb = tmp;
                }
                int mod = aa % bb;
                while(mod != 0){
                    aa = bb;
                    bb = mod;
                    mod = aa % bb;
                }
                System.out.println(bb+" "+(a/bb*b));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}