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

public class Main {

    public static void main(String[] args) throws IOException {
        String str;
        BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
        while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        }
    }

    public static long FindGCD(long a, long b){
        long r = a % b;
        while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }

    public static long FindLCM(long a, long b) {
        return (a * b) / FindGCD(a, b);
    }
} 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 public class Main {

    public static void main(String[] args) throws IOException {
        String str;
        BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
        while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        }
    }

    public static long FindGCD(long a, long b){
        long r = a % b;
        while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }

    public static long FindLCM(long a, long b) {
        return (a * b) / FindGCD(a, b);
    }
} Main public static void main(String[] args) throws IOException {
        String str;
        BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
        while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        }
    } main {
        String str;
        BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
        while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        }
    } String str; str BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in)); bReader new BufferedReader(new InputStreamReader(System.in)) while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        } (str = bReader.readLine()) != null (str = bReader.readLine()) str bReader.readLine() bReader.readLine bReader null {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        } String[] editedStr = str.split(" "); editedStr str.split(" ") str.split str " " Arrays.sort(editedStr) Arrays.sort Arrays editedStr System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1]))) System.out.println System.out System System.out FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) FindGCD Long.parseLong(editedStr[0]) Long.parseLong Long editedStr[0] editedStr 0 Long.parseLong(editedStr[1]) Long.parseLong Long editedStr[1] editedStr 1 " " FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) FindLCM Long.parseLong(editedStr[0]) Long.parseLong Long editedStr[0] editedStr 0 Long.parseLong(editedStr[1]) Long.parseLong Long editedStr[1] editedStr 1 String[] args args public static long FindGCD(long a, long b){
        long r = a % b;
        while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    } FindGCD {
        long r = a % b;
        while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    } long r = a % b; r a % b a b while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        } r > 0 r 0 {
            a = b;
            b = r;
            r = a % b;
        } a = b a b b = r b r r = a % b r a % b a b return b; b long a a long b b public static long FindLCM(long a, long b) {
        return (a * b) / FindGCD(a, b);
    } FindLCM {
        return (a * b) / FindGCD(a, b);
    } return (a * b) / FindGCD(a, b); (a * b) / FindGCD(a, b) (a * b) a b FindGCD(a, b) FindGCD a b long a a long b b public class Main {

    public static void main(String[] args) throws IOException {
        String str;
        BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
        while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        }
    }

    public static long FindGCD(long a, long b){
        long r = a % b;
        while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }

    public static long FindLCM(long a, long b) {
        return (a * b) / FindGCD(a, b);
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        String str;
        BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
        while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        }
    }

    public static long FindGCD(long a, long b){
        long r = a % b;
        while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }

    public static long FindLCM(long a, long b) {
        return (a * b) / FindGCD(a, b);
    }
} Main

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

public class Main {

    public static void main(String[] args) throws IOException {
        String str;
        BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
        while ((str = bReader.readLine()) != null) {
            String[] editedStr = str.split(" ");
            Arrays.sort(editedStr);
            System.out.println(FindGCD(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])) + " " + FindLCM(Long.parseLong(editedStr[0]), Long.parseLong(editedStr[1])));
        }
    }

    public static long FindGCD(long a, long b){
        long r = a % b;
        while (r > 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }

    public static long FindLCM(long a, long b) {
        return (a * b) / FindGCD(a, b);
    }
}