import java.util.*;
public class Main{
 void run() {
  Scanner sc = new Scanner(System.in);
  for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  }
 }
 long gcd(long a, long b){
  if(b==0) return a;
  return gcd(b, a%b);
 }
 long lcm(long a, long b){
  return a/gcd(a, b)*b;
 }
 public static void main(String[] args){
  new Main().run();
 }
} import java.util.*; util.* java public class Main{
 void run() {
  Scanner sc = new Scanner(System.in);
  for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  }
 }
 long gcd(long a, long b){
  if(b==0) return a;
  return gcd(b, a%b);
 }
 long lcm(long a, long b){
  return a/gcd(a, b)*b;
 }
 public static void main(String[] args){
  new Main().run();
 }
} Main void run() {
  Scanner sc = new Scanner(System.in);
  for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  }
 } run {
  Scanner sc = new Scanner(System.in);
  for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  }
 } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  } ; sc.hasNext() sc.hasNext sc {
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  } {
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  } long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong 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 long gcd(long a, long b){
  if(b==0) return a;
  return gcd(b, a%b);
 } gcd {
  if(b==0) return a;
  return gcd(b, a%b);
 } if(b==0) return a; b==0 b 0 return a; a return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b long a a long b b long lcm(long a, long 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 long a a long b b public static void main(String[] args){
  new Main().run();
 } main {
  new Main().run();
 } new Main().run() new Main().run new Main() String[] args args public class Main{
 void run() {
  Scanner sc = new Scanner(System.in);
  for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  }
 }
 long gcd(long a, long b){
  if(b==0) return a;
  return gcd(b, a%b);
 }
 long lcm(long a, long b){
  return a/gcd(a, b)*b;
 }
 public static void main(String[] args){
  new Main().run();
 }
} public class Main{
 void run() {
  Scanner sc = new Scanner(System.in);
  for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  }
 }
 long gcd(long a, long b){
  if(b==0) return a;
  return gcd(b, a%b);
 }
 long lcm(long a, long b){
  return a/gcd(a, b)*b;
 }
 public static void main(String[] args){
  new Main().run();
 }
} Main
import java.util.*;
public class Main{
 void run() {
  Scanner sc = new Scanner(System.in);
  for(;sc.hasNext();){
   long a = sc.nextLong();
   long b = sc.nextLong();
   System.out.println( gcd(a, b) + " " + lcm(a, b) );
  }
 }
 long gcd(long a, long b){
  if(b==0) return a;
  return gcd(b, a%b);
 }
 long lcm(long a, long b){
  return a/gcd(a, b)*b;
 }
 public static void main(String[] args){
  new Main().run();
 }
}