import java.util.*;
public class Dimo{
public static int y(int a, int b){
int x=1;
if(a>b){
int m=a;
a=b;
b=m;
}
while(x!=0){
x=(b%a);
if(x!=0){
b=(b/a);
a=x;
}
}
return b;
}
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int n = y(a,b);
if(n!=0){
System.out.println(n);
System.out.println(((a*b)/n));
}else{
System.out.println("err");
}
}
}