import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    while (sc.hasNext()) {
      int a = sc.nextInt();
      int b = sc.nextInt();

      System.out.println(gcd(a, b) + " " + lcm(a, b));
    }
  }

  static void swap(int a, int b) {
    int temp = a;
    a = b;
    b = temp;
  }

  static int gcd(int a, int b) {
    if (a < b) swap(a, b);

    while (b != 0) {
      int temp = b;
      b = a % b;
      a = temp;
    }

    return a;
  }

  static int lcm(int a, int b) {
    return a / gcd(a, b) * b;
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    while (sc.hasNext()) {
      int a = sc.nextInt();
      int b = sc.nextInt();

      System.out.println(gcd(a, b) + " " + lcm(a, b));
    }
  }

  static void swap(int a, int b) {
    int temp = a;
    a = b;
    b = temp;
  }

  static int gcd(int a, int b) {
    if (a < b) swap(a, b);

    while (b != 0) {
      int temp = b;
      b = a % b;
      a = temp;
    }

    return a;
  }

  static int lcm(int a, int b) {
    return a / gcd(a, b) * b;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    while (sc.hasNext()) {
      int a = sc.nextInt();
      int b = sc.nextInt();

      System.out.println(gcd(a, b) + " " + lcm(a, b));
    }
  } main {
    Scanner sc = new Scanner(System.in);

    while (sc.hasNext()) {
      int a = sc.nextInt();
      int b = sc.nextInt();

      System.out.println(gcd(a, b) + " " + lcm(a, b));
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNext()) {
      int a = sc.nextInt();
      int b = sc.nextInt();

      System.out.println(gcd(a, b) + " " + lcm(a, b));
    } sc.hasNext() sc.hasNext sc {
      int a = sc.nextInt();
      int b = sc.nextInt();

      System.out.println(gcd(a, b) + " " + lcm(a, b));
    } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc System.out.println(gcd(a, b) + " " + lcm(a, b)) System.out.println System.out System System.out gcd(a, b) + " " + lcm(a, b) gcd(a, b) + " " + lcm(a, b) gcd(a, b) gcd a b " " lcm(a, b) lcm a b String[] args args static void swap(int a, int b) {
    int temp = a;
    a = b;
    b = temp;
  } swap {
    int temp = a;
    a = b;
    b = temp;
  } int temp = a; temp a a = b a b b = temp b temp int a a int b b static int gcd(int a, int b) {
    if (a < b) swap(a, b);

    while (b != 0) {
      int temp = b;
      b = a % b;
      a = temp;
    }

    return a;
  } gcd {
    if (a < b) swap(a, b);

    while (b != 0) {
      int temp = b;
      b = a % b;
      a = temp;
    }

    return a;
  } if (a < b) swap(a, b); a < b a b swap(a, b) swap a b while (b != 0) {
      int temp = b;
      b = a % b;
      a = temp;
    } b != 0 b 0 {
      int temp = b;
      b = a % b;
      a = temp;
    } int temp = b; temp b b = a % b b a % b a b a = temp a temp return a; a int a a int b b static int lcm(int a, int b) {
    return a / gcd(a, b) * b;
  } lcm {
    return a / gcd(a, b) * b;
  } return a / gcd(a, b) * b; a / gcd(a, b) * b a / gcd(a, b) a gcd(a, b) gcd a b b int a a int b b
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    while (sc.hasNext()) {
      int a = sc.nextInt();
      int b = sc.nextInt();

      System.out.println(gcd(a, b) + " " + lcm(a, b));
    }
  }

  static void swap(int a, int b) {
    int temp = a;
    a = b;
    b = temp;
  }

  static int gcd(int a, int b) {
    if (a < b) swap(a, b);

    while (b != 0) {
      int temp = b;
      b = a % b;
      a = temp;
    }

    return a;
  }

  static int lcm(int a, int b) {
    return a / gcd(a, b) * b;
  }
}