import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main {

  static long gcd(long a, long b) {
    return b == 0 ? a : gcd(b, a%b);
  }

  static long lcm(long t, long ab) {
    return ab / t;
  }

  public static void main(String[] args) throws IOException {
    long a, b, t;
    BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
    String str;
    String[] array = new String[2];
    while ((str = buf.readLine()) != null) {
      array = str.split(" ");
      a = Long.parseLong(array[0]);
      b = Long.parseLong(array[1]);
      t = gcd(a, b);
      System.out.println(t + " " + lcm(t, a*b));
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io class Main {

  static long gcd(long a, long b) {
    return b == 0 ? a : gcd(b, a%b);
  }

  static long lcm(long t, long ab) {
    return ab / t;
  }

  public static void main(String[] args) throws IOException {
    long a, b, t;
    BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
    String str;
    String[] array = new String[2];
    while ((str = buf.readLine()) != null) {
      array = str.split(" ");
      a = Long.parseLong(array[0]);
      b = Long.parseLong(array[1]);
      t = gcd(a, b);
      System.out.println(t + " " + lcm(t, a*b));
    }
  }
} Main static long gcd(long a, long b) {
    return b == 0 ? a : gcd(b, a%b);
  } gcd {
    return b == 0 ? a : gcd(b, a%b);
  } return b == 0 ? a : gcd(b, a%b); b == 0 ? a : gcd(b, a%b) b == 0 b 0 a gcd(b, a%b) gcd b a%b a b long a a long b b static long lcm(long t, long ab) {
    return ab / t;
  } lcm {
    return ab / t;
  } return ab / t; ab / t ab t long t t long ab ab public static void main(String[] args) throws IOException {
    long a, b, t;
    BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
    String str;
    String[] array = new String[2];
    while ((str = buf.readLine()) != null) {
      array = str.split(" ");
      a = Long.parseLong(array[0]);
      b = Long.parseLong(array[1]);
      t = gcd(a, b);
      System.out.println(t + " " + lcm(t, a*b));
    }
  } main {
    long a, b, t;
    BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
    String str;
    String[] array = new String[2];
    while ((str = buf.readLine()) != null) {
      array = str.split(" ");
      a = Long.parseLong(array[0]);
      b = Long.parseLong(array[1]);
      t = gcd(a, b);
      System.out.println(t + " " + lcm(t, a*b));
    }
  } long a a b b t; t BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) String str; str String[] array = new String[2]; array new String[2] 2 while ((str = buf.readLine()) != null) {
      array = str.split(" ");
      a = Long.parseLong(array[0]);
      b = Long.parseLong(array[1]);
      t = gcd(a, b);
      System.out.println(t + " " + lcm(t, a*b));
    } (str = buf.readLine()) != null (str = buf.readLine()) str buf.readLine() buf.readLine buf null {
      array = str.split(" ");
      a = Long.parseLong(array[0]);
      b = Long.parseLong(array[1]);
      t = gcd(a, b);
      System.out.println(t + " " + lcm(t, a*b));
    } array = str.split(" ") array str.split(" ") str.split str " " a = Long.parseLong(array[0]) a Long.parseLong(array[0]) Long.parseLong Long array[0] array 0 b = Long.parseLong(array[1]) b Long.parseLong(array[1]) Long.parseLong Long array[1] array 1 t = gcd(a, b) t gcd(a, b) gcd a b System.out.println(t + " " + lcm(t, a*b)) System.out.println System.out System System.out t + " " + lcm(t, a*b) t + " " + lcm(t, a*b) t " " lcm(t, a*b) lcm t a*b a b String[] args args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main {

  static long gcd(long a, long b) {
    return b == 0 ? a : gcd(b, a%b);
  }

  static long lcm(long t, long ab) {
    return ab / t;
  }

  public static void main(String[] args) throws IOException {
    long a, b, t;
    BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
    String str;
    String[] array = new String[2];
    while ((str = buf.readLine()) != null) {
      array = str.split(" ");
      a = Long.parseLong(array[0]);
      b = Long.parseLong(array[1]);
      t = gcd(a, b);
      System.out.println(t + " " + lcm(t, a*b));
    }
  }
}