import java.util.*;

public class Main{
   public static void main(String[] args) {
	  Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   }
   }
} import java.util.*; util.* java public class Main{
   public static void main(String[] args) {
	  Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   }
   }
} Main public static void main(String[] args) {
	  Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   }
   } main {
	  Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   }
   } Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int a a b; b while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   } sc.hasNext() sc.hasNext sc {
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   } int n1=sc.nextInt(); n1 sc.nextInt() sc.nextInt sc int n2=sc.nextInt(); n2 sc.nextInt() sc.nextInt sc a=Math.max(n1,n2) a Math.max(n1,n2) Math.max Math n1 n2 b=Math.min(n1,n2) b Math.min(n1,n2) Math.min Math n1 n2 for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
} ; {
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
} {
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
} a =a%b a a%b a b if(a==0)break; a==0 a 0 break; int temp=b; temp b b=a b a a=temp a temp System.out.println(b+" "+(long)n1*n2/b) System.out.println System.out System System.out b+" "+(long)n1*n2/b b+" "+(long)n1*n2/b b " " (long)n1*n2/b (long)n1*n2 (long)n1 n2 b String[] args args public class Main{
   public static void main(String[] args) {
	  Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   }
   }
} public class Main{
   public static void main(String[] args) {
	  Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   }
   }
} Main
import java.util.*;

public class Main{
   public static void main(String[] args) {
	  Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
   }
   }
}