import java.util.*;
public class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int a,b,i,c,d;
    while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    }
  }
} import java.util.*; util.* java public class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int a,b,i,c,d;
    while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    }
  }
} Main public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int a,b,i,c,d;
    while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int a,b,i,c,d;
    while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a a b b i i c c d; d while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    } sc.hasNext() sc.hasNext sc {
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    } a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc d = 1 d 1 for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      } i = 1; i = 1 i 1 i <= Math.min(a,b) i Math.min(a,b) Math.min Math a b i++ i++ i {
        if(a % i == 0 && b % i == 0)d = i;
      } {
        if(a % i == 0 && b % i == 0)d = i;
      } if(a % i == 0 && b % i == 0)d = i; a % i == 0 && b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 d = i d i c = a / d * b c a / d * b a / d a d b System.out.println(d + " " + c) System.out.println System.out System System.out d + " " + c d + " " + c d " " c String [] args args public class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int a,b,i,c,d;
    while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    }
  }
} public class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int a,b,i,c,d;
    while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    }
  }
} Main
import java.util.*;
public class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int a,b,i,c,d;
    while(sc.hasNext()){
      a = sc.nextInt();
      b = sc.nextInt();
      d = 1;
      for(i = 1;i <= Math.min(a,b);i++){
        if(a % i == 0 && b % i == 0)d = i;
      }
      c = a / d * b ;
      System.out.println(d + " " + c);
    }
  }
}