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

public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String readStr;
    while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    }

  }

  public static long gcd(long m, long n) {
    return n == 0 ? m : gcd(n,m%n);
  }

  public static long lcm(long m, long n) {
    return m*n/gcd(m, n);
  }
  
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String readStr;
    while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    }

  }

  public static long gcd(long m, long n) {
    return n == 0 ? m : gcd(n,m%n);
  }

  public static long lcm(long m, long n) {
    return m*n/gcd(m, n);
  }
  
} Main public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String readStr;
    while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    }

  } main {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String readStr;
    while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    }

  } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String readStr; readStr while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    } (readStr = reader.readLine()) != null (readStr = reader.readLine()) readStr reader.readLine() reader.readLine reader null {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    } long l = Integer.parseInt(readStr.split(" ")[0]); l Integer.parseInt(readStr.split(" ")[0]) Integer.parseInt Integer readStr.split(" ")[0] readStr.split(" ") readStr.split readStr " " 0 long r = Integer.parseInt(readStr.split(" ")[1]); r Integer.parseInt(readStr.split(" ")[1]) Integer.parseInt Integer readStr.split(" ")[1] readStr.split(" ") readStr.split readStr " " 1 System.out.println(gcd(l, r) + " " + lcm(l, r)) System.out.println System.out System System.out gcd(l, r) + " " + lcm(l, r) gcd(l, r) + " " + lcm(l, r) gcd(l, r) gcd l r " " lcm(l, r) lcm l r String[] args args public static long gcd(long m, long n) {
    return n == 0 ? m : gcd(n,m%n);
  } gcd {
    return n == 0 ? m : gcd(n,m%n);
  } return n == 0 ? m : gcd(n,m%n); n == 0 ? m : gcd(n,m%n) n == 0 n 0 m gcd(n,m%n) gcd n m%n m n long m m long n n public static long lcm(long m, long n) {
    return m*n/gcd(m, n);
  } lcm {
    return m*n/gcd(m, n);
  } return m*n/gcd(m, n); m*n/gcd(m, n) m*n m n gcd(m, n) gcd m n long m m long n n public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String readStr;
    while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    }

  }

  public static long gcd(long m, long n) {
    return n == 0 ? m : gcd(n,m%n);
  }

  public static long lcm(long m, long n) {
    return m*n/gcd(m, n);
  }
  
} public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String readStr;
    while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    }

  }

  public static long gcd(long m, long n) {
    return n == 0 ? m : gcd(n,m%n);
  }

  public static long lcm(long m, long n) {
    return m*n/gcd(m, n);
  }
  
} Main

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

public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String readStr;
    while ((readStr = reader.readLine()) != null) {
      long l = Integer.parseInt(readStr.split(" ")[0]);
      long r = Integer.parseInt(readStr.split(" ")[1]);
      
      System.out.println(gcd(l, r) + " " + lcm(l, r));
    }

  }

  public static long gcd(long m, long n) {
    return n == 0 ? m : gcd(n,m%n);
  }

  public static long lcm(long m, long n) {
    return m*n/gcd(m, n);
  }
  
}