import java.io.*;
import java.util.*;
class Main{
    public static void main(String[] args)throws IOException{
	Scanner s = new Scanner(System.in);
	long a,b;
	
	while(s.hasNext()){
	    a=s.nextInt();
	    b=s.nextInt();
	    System.out.println(getGCD(a,b)+" "+getLCM(a,b));
	    /* System.out.println(a*b);*/
	}
    }
    
    
  
    
    static long getGCD(long a, long b){
	if(b==0)
	    return a;
	else return getGCD(b ,a%b);
	
	    }

      static long getLCM(long a,long b){
	  return a*b/(getGCD(a,b));
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String[] args)throws IOException{
	Scanner s = new Scanner(System.in);
	long a,b;
	
	while(s.hasNext()){
	    a=s.nextInt();
	    b=s.nextInt();
	    System.out.println(getGCD(a,b)+" "+getLCM(a,b));
	    /* System.out.println(a*b);*/
	}
    }
    
    
  
    
    static long getGCD(long a, long b){
	if(b==0)
	    return a;
	else return getGCD(b ,a%b);
	
	    }

      static long getLCM(long a,long b){
	  return a*b/(getGCD(a,b));
    }
} Main public static void main(String[] args)throws IOException{
	Scanner s = new Scanner(System.in);
	long a,b;
	
	while(s.hasNext()){
	    a=s.nextInt();
	    b=s.nextInt();
	    System.out.println(getGCD(a,b)+" "+getLCM(a,b));
	    /* System.out.println(a*b);*/
	}
    } main {
	Scanner s = new Scanner(System.in);
	long a,b;
	
	while(s.hasNext()){
	    a=s.nextInt();
	    b=s.nextInt();
	    System.out.println(getGCD(a,b)+" "+getLCM(a,b));
	    /* System.out.println(a*b);*/
	}
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) long a a b; b while(s.hasNext()){
	    a=s.nextInt();
	    b=s.nextInt();
	    System.out.println(getGCD(a,b)+" "+getLCM(a,b));
	    /* System.out.println(a*b);*/
	} s.hasNext() s.hasNext s {
	    a=s.nextInt();
	    b=s.nextInt();
	    System.out.println(getGCD(a,b)+" "+getLCM(a,b));
	    /* System.out.println(a*b);*/
	} a=s.nextInt() a s.nextInt() s.nextInt s b=s.nextInt() b s.nextInt() s.nextInt s System.out.println(getGCD(a,b)+" "+getLCM(a,b)) System.out.println System.out System System.out getGCD(a,b)+" "+getLCM(a,b) getGCD(a,b)+" "+getLCM(a,b) getGCD(a,b) getGCD a b " " getLCM(a,b) getLCM a b String[] args args static long getGCD(long a, long b){
	if(b==0)
	    return a;
	else return getGCD(b ,a%b);
	
	    } getGCD {
	if(b==0)
	    return a;
	else return getGCD(b ,a%b);
	
	    } if(b==0)
	    return a;
	else return getGCD(b ,a%b); b==0 b 0 return a; a return getGCD(b ,a%b); getGCD(b ,a%b) getGCD b a%b a b long a a long b b static long getLCM(long a,long b){
	  return a*b/(getGCD(a,b));
    } getLCM {
	  return a*b/(getGCD(a,b));
    } return a*b/(getGCD(a,b)); a*b/(getGCD(a,b)) a*b a b (getGCD(a,b)) getGCD a b long a a long b b
import java.io.*;
import java.util.*;
class Main{
    public static void main(String[] args)throws IOException{
	Scanner s = new Scanner(System.in);
	long a,b;
	
	while(s.hasNext()){
	    a=s.nextInt();
	    b=s.nextInt();
	    System.out.println(getGCD(a,b)+" "+getLCM(a,b));
	    /* System.out.println(a*b);*/
	}
    }
    
    
  
    
    static long getGCD(long a, long b){
	if(b==0)
	    return a;
	else return getGCD(b ,a%b);
	
	    }

      static long getLCM(long a,long b){
	  return a*b/(getGCD(a,b));
    }
}