import java.util.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int a;
      int b;
      int gcd;
      int lcm;
         
         
      while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      }    
   }//main
   
   public static int Euclid(int a, int b){
      int remainder;
      if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      }
   }
   
   public static int LCM(int a, int b){
      int k = 1;
      while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      }
   }
   
}//class import java.util.*; util.* java public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int a;
      int b;
      int gcd;
      int lcm;
         
         
      while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      }    
   }//main
   
   public static int Euclid(int a, int b){
      int remainder;
      if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      }
   }
   
   public static int LCM(int a, int b){
      int k = 1;
      while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      }
   }
   
}//class Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int a;
      int b;
      int gcd;
      int lcm;
         
         
      while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      }    
   }//main main {
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int a;
      int b;
      int gcd;
      int lcm;
         
         
      while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      }    
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str; str String[] arr; arr int a; a int b; b int gcd; gcd int lcm; lcm while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      } sc.hasNext() sc.hasNext sc {
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      } str = sc.nextLine() str sc.nextLine() sc.nextLine sc arr = str.split(" ") arr str.split(" ") str.split str " " Arrays.sort(arr) Arrays.sort Arrays arr a = Integer.parseInt(arr[0]) a Integer.parseInt(arr[0]) Integer.parseInt Integer arr[0] arr 0 b = Integer.parseInt(arr[1]) b Integer.parseInt(arr[1]) Integer.parseInt Integer arr[1] arr 1 gcd = Euclid(a,b) gcd Euclid(a,b) Euclid a b lcm = LCM(a,b) lcm LCM(a,b) LCM a b System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm String[] args args public static int Euclid(int a, int b){
      int remainder;
      if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      }
   } Euclid {
      int remainder;
      if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      }
   } int remainder; remainder if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      } a%b == 0 a%b a b 0 {
         return b;
      } return b; b {
         remainder = a%b;
         return Euclid(b,remainder);
      } remainder = a%b remainder a%b a b return Euclid(b,remainder); Euclid(b,remainder) Euclid b remainder int a a int b b public static int LCM(int a, int b){
      int k = 1;
      while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      }
   } LCM {
      int k = 1;
      while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      }
   } int k = 1; k 1 while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      } true {
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      } if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         } (b*k)%a == 0 (b*k)%a (b*k) b k a 0 {
            return b*k;
         } return b*k; b*k b k {
            k++;
         } k++ k int a a int b b public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int a;
      int b;
      int gcd;
      int lcm;
         
         
      while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      }    
   }//main
   
   public static int Euclid(int a, int b){
      int remainder;
      if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      }
   }
   
   public static int LCM(int a, int b){
      int k = 1;
      while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      }
   }
   
}//class public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int a;
      int b;
      int gcd;
      int lcm;
         
         
      while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      }    
   }//main
   
   public static int Euclid(int a, int b){
      int remainder;
      if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      }
   }
   
   public static int LCM(int a, int b){
      int k = 1;
      while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      }
   }
   
}//class Main
import java.util.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int a;
      int b;
      int gcd;
      int lcm;
         
         
      while(sc.hasNext()){
         str = sc.nextLine();
         arr = str.split(" ");
         Arrays.sort(arr);
         a = Integer.parseInt(arr[0]);
         b = Integer.parseInt(arr[1]);
            
         gcd = Euclid(a,b);
         lcm = LCM(a,b);
         
         
         System.out.println(gcd + " " + lcm);
      }    
   }//main
   
   public static int Euclid(int a, int b){
      int remainder;
      if(a%b == 0){
         return b;
      }else{
         remainder = a%b;
         return Euclid(b,remainder);
      }
   }
   
   public static int LCM(int a, int b){
      int k = 1;
      while(true){
         if((b*k)%a == 0){
            return b*k;
         }else{
            k++;
         }
      }
   }
   
}//class