import java.util.Scanner;

class Main {

    static int gcd(int a, int b){
	if(a < b){
	    int temp = a;
	    a = b;
	    b = temp;
	}
	
	while(b != 0){
	    int temp = b;
	    b = a % b;
	    a = temp;
	}
	return a;	    
    }

    static int lcm(int a, int b){
	a /= gcd(a, b);
	return a * b;
    }
    
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	while(stdin.hasNextInt()){
	    int a = stdin.nextInt();
	    int b = stdin.nextInt();
	    System.out.println(gcd(a, b) + " " + lcm(a, b));
	}
    }
} import java.util.Scanner; Scanner java.util class Main {

    static int gcd(int a, int b){
	if(a < b){
	    int temp = a;
	    a = b;
	    b = temp;
	}
	
	while(b != 0){
	    int temp = b;
	    b = a % b;
	    a = temp;
	}
	return a;	    
    }

    static int lcm(int a, int b){
	a /= gcd(a, b);
	return a * b;
    }
    
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	while(stdin.hasNextInt()){
	    int a = stdin.nextInt();
	    int b = stdin.nextInt();
	    System.out.println(gcd(a, b) + " " + lcm(a, b));
	}
    }
} Main static int gcd(int a, int b){
	if(a < b){
	    int temp = a;
	    a = b;
	    b = temp;
	}
	
	while(b != 0){
	    int temp = b;
	    b = a % b;
	    a = temp;
	}
	return a;	    
    } gcd {
	if(a < b){
	    int temp = a;
	    a = b;
	    b = temp;
	}
	
	while(b != 0){
	    int temp = b;
	    b = a % b;
	    a = temp;
	}
	return a;	    
    } if(a < b){
	    int temp = a;
	    a = b;
	    b = temp;
	} a < b a b {
	    int temp = a;
	    a = b;
	    b = temp;
	} int temp = a; temp a a = b a b b = temp b temp while(b != 0){
	    int temp = b;
	    b = a % b;
	    a = temp;
	} b != 0 b 0 {
	    int temp = b;
	    b = a % b;
	    a = temp;
	} int temp = b; temp b b = a % b b a % b a b a = temp a temp return a; a int a a int b b static int lcm(int a, int b){
	a /= gcd(a, b);
	return a * b;
    } lcm {
	a /= gcd(a, b);
	return a * b;
    } a /= gcd(a, b) a gcd(a, b) gcd a b return a * b; a * b a b int a a int b b public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	while(stdin.hasNextInt()){
	    int a = stdin.nextInt();
	    int b = stdin.nextInt();
	    System.out.println(gcd(a, b) + " " + lcm(a, b));
	}
    } main {
	Scanner stdin = new Scanner(System.in);
	while(stdin.hasNextInt()){
	    int a = stdin.nextInt();
	    int b = stdin.nextInt();
	    System.out.println(gcd(a, b) + " " + lcm(a, b));
	}
    } Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) while(stdin.hasNextInt()){
	    int a = stdin.nextInt();
	    int b = stdin.nextInt();
	    System.out.println(gcd(a, b) + " " + lcm(a, b));
	} stdin.hasNextInt() stdin.hasNextInt stdin {
	    int a = stdin.nextInt();
	    int b = stdin.nextInt();
	    System.out.println(gcd(a, b) + " " + lcm(a, b));
	} int a = stdin.nextInt(); a stdin.nextInt() stdin.nextInt stdin int b = stdin.nextInt(); b stdin.nextInt() stdin.nextInt stdin System.out.println(gcd(a, b) + " " + lcm(a, b)) System.out.println System.out System System.out gcd(a, b) + " " + lcm(a, b) gcd(a, b) + " " + lcm(a, b) gcd(a, b) gcd a b " " lcm(a, b) lcm a b String[] args args
import java.util.Scanner;

class Main {

    static int gcd(int a, int b){
	if(a < b){
	    int temp = a;
	    a = b;
	    b = temp;
	}
	
	while(b != 0){
	    int temp = b;
	    b = a % b;
	    a = temp;
	}
	return a;	    
    }

    static int lcm(int a, int b){
	a /= gcd(a, b);
	return a * b;
    }
    
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	while(stdin.hasNextInt()){
	    int a = stdin.nextInt();
	    int b = stdin.nextInt();
	    System.out.println(gcd(a, b) + " " + lcm(a, b));
	}
    }
}