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

public class Main {

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

        while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        }
    }

    static int gcd(int a, int b){
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    }

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

    static int lcm(int a, int b){
    	int g = gcd(a, b);

    	return lcm(a,b,g);
    }

} 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) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        }
    }

    static int gcd(int a, int b){
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    }

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

    static int lcm(int a, int b){
    	int g = gcd(a, b);

    	return lcm(a,b,g);
    }

} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        } true {
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        } String tmp = br.readLine(); tmp br.readLine() br.readLine br if(tmp == null){
                break;
            } tmp == null tmp null {
                break;
            } break; String[] tmpArray = tmp.split(" "); tmpArray tmp.split(" ") tmp.split tmp " " int a = Integer.parseInt(tmpArray[0]); a Integer.parseInt(tmpArray[0]) Integer.parseInt Integer tmpArray[0] tmpArray 0 int b = Integer.parseInt(tmpArray[1]); b Integer.parseInt(tmpArray[1]) Integer.parseInt Integer tmpArray[1] tmpArray 1 int GCD = gcd(a, b); GCD gcd(a, b) gcd a b int LCM = lcm(a, b, GCD); LCM lcm(a, b, GCD) lcm a b GCD System.out.println(GCD + " "+ LCM) System.out.println System.out System System.out GCD + " "+ LCM GCD + " "+ LCM GCD " " LCM String[] args args static int gcd(int a, int b){
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    } gcd {
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    } int tmp; tmp while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	} a % b != 0 a % b a b 0 {
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	} tmp = b tmp b b = a % b b a % b a b a = tmp a tmp return b; b int a a int b b static int lcm(int a, int b, int gcd){
    	return a*(b/gcd);
    } lcm {
    	return a*(b/gcd);
    } return a*(b/gcd); a*(b/gcd) a (b/gcd) b gcd int a a int b b int gcd gcd static int lcm(int a, int b){
    	int g = gcd(a, b);

    	return lcm(a,b,g);
    } lcm {
    	int g = gcd(a, b);

    	return lcm(a,b,g);
    } int g = gcd(a, b); g gcd(a, b) gcd a b return lcm(a,b,g); lcm(a,b,g) lcm a b g int a a int b b public class Main {

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

        while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        }
    }

    static int gcd(int a, int b){
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    }

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

    static int lcm(int a, int b){
    	int g = gcd(a, b);

    	return lcm(a,b,g);
    }

} public class Main {

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

        while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        }
    }

    static int gcd(int a, int b){
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    }

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

    static int lcm(int a, int b){
    	int g = gcd(a, b);

    	return lcm(a,b,g);
    }

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

public class Main {

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

        while(true){
            String tmp = br.readLine();

            if(tmp == null){
                break;
            }

            String[] tmpArray = tmp.split(" ");
            int a = Integer.parseInt(tmpArray[0]);
            int b = Integer.parseInt(tmpArray[1]);

            int GCD = gcd(a, b);

            int LCM = lcm(a, b, GCD);
            System.out.println(GCD + " "+ LCM);
        }
    }

    static int gcd(int a, int b){
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    }

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

    static int lcm(int a, int b){
    	int g = gcd(a, b);

    	return lcm(a,b,g);
    }

}