import java.util.*;
import java.io.*;
class Main{
    int gcd(int p, int q){
	return q==0?p:gcd(q,p%q);
    }

    void ruun(){
	Scanner sc = new Scanner(System.in);
	int x, y, z;
	while(sc.hasNext()){
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	}
    }

    public static void main(String[] args){
	new Main().ruun();
    }
} import java.util.*; util.* java import java.io.*; io.* java class Main{
    int gcd(int p, int q){
	return q==0?p:gcd(q,p%q);
    }

    void ruun(){
	Scanner sc = new Scanner(System.in);
	int x, y, z;
	while(sc.hasNext()){
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	}
    }

    public static void main(String[] args){
	new Main().ruun();
    }
} Main int gcd(int p, int q){
	return q==0?p:gcd(q,p%q);
    } gcd {
	return q==0?p:gcd(q,p%q);
    } return q==0?p:gcd(q,p%q); q==0?p:gcd(q,p%q) q==0 q 0 p gcd(q,p%q) gcd q p%q p q int p p int q q void ruun(){
	Scanner sc = new Scanner(System.in);
	int x, y, z;
	while(sc.hasNext()){
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	}
    } ruun {
	Scanner sc = new Scanner(System.in);
	int x, y, z;
	while(sc.hasNext()){
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	}
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x x y y z; z while(sc.hasNext()){
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	} sc.hasNext() sc.hasNext sc {
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	} x = sc.nextInt() x sc.nextInt() sc.nextInt sc y= sc.nextInt() y sc.nextInt() sc.nextInt sc z = gcd(Math.max(x,y), Math.min(x,y)) z gcd(Math.max(x,y), Math.min(x,y)) gcd Math.max(x,y) Math.max Math x y Math.min(x,y) Math.min Math x y System.out.println(z+" "+x/z*y) System.out.println System.out System System.out z+" "+x/z*y z+" "+x/z*y z " " x/z*y x/z x z y public static void main(String[] args){
	new Main().ruun();
    } main {
	new Main().ruun();
    } new Main().ruun() new Main().ruun new Main() String[] args args
import java.util.*;
import java.io.*;
class Main{
    int gcd(int p, int q){
	return q==0?p:gcd(q,p%q);
    }

    void ruun(){
	Scanner sc = new Scanner(System.in);
	int x, y, z;
	while(sc.hasNext()){
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	}
    }

    public static void main(String[] args){
	new Main().ruun();
    }
}