import java.util.*;
class Main{
  public static void main(String[] a){
    String b =" ";
    String c =" ";
    Scanner k = new Scanner( System.in);
    try{
      while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      }
      
    }finally{
      k.close();
    }
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] a){
    String b =" ";
    String c =" ";
    Scanner k = new Scanner( System.in);
    try{
      while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      }
      
    }finally{
      k.close();
    }
  }
} Main public static void main(String[] a){
    String b =" ";
    String c =" ";
    Scanner k = new Scanner( System.in);
    try{
      while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      }
      
    }finally{
      k.close();
    }
  } main {
    String b =" ";
    String c =" ";
    Scanner k = new Scanner( System.in);
    try{
      while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      }
      
    }finally{
      k.close();
    }
  } String b =" "; b " " String c =" "; c " " Scanner k = new Scanner( System.in); k new Scanner( System.in) try{
      while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      }
      
    }finally{
      k.close();
    } {
      k.close();
    } k.close() k.close k {
      while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      }
      
    } while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      } k.hasNextLine() k.hasNextLine k {
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      } String line = k.nextLine(); line k.nextLine() k.nextLine k StringTokenizer st = new StringTokenizer(line); st new StringTokenizer(line) int count=0; count 0 while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        } st.hasMoreTokens() st.hasMoreTokens st {
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        } if(count==1){
            c=st.nextToken();
          } count==1 count 1 {
            c=st.nextToken();
          } c=st.nextToken() c st.nextToken() st.nextToken st if(count==0){
            b = st.nextToken();
            count++;
          } count==0 count 0 {
            b = st.nextToken();
            count++;
          } b = st.nextToken() b st.nextToken() st.nextToken st count++ count long dividend=0; dividend 0 long divisor=0; divisor 0 long remainder=1; remainder 1 long i = Long.parseLong(b); i Long.parseLong(b) Long.parseLong Long b long j = Long.parseLong(c); j Long.parseLong(c) Long.parseLong Long c if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        } i>j i j {
          dividend = i;
          divisor = j;
        } dividend = i dividend i divisor = j divisor j {
          dividend = j;
          divisor = i;
        } dividend = j dividend j divisor = i divisor i while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        } remainder!=0 remainder 0 {         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        } remainder = dividend%divisor remainder dividend%divisor dividend divisor dividend = divisor dividend divisor if(remainder==0){
            break;
          }else{
            divisor = remainder;
          } remainder==0 remainder 0 {
            break;
          } break; {
            divisor = remainder;
          } divisor = remainder divisor remainder long lcm = (i*j)/divisor; lcm (i*j)/divisor (i*j) i j divisor System.out.println(divisor+" "+lcm) System.out.println System.out System System.out divisor+" "+lcm divisor+" "+lcm divisor " " lcm String[] a a
import java.util.*;
class Main{
  public static void main(String[] a){
    String b =" ";
    String c =" ";
    Scanner k = new Scanner( System.in);
    try{
      while(k.hasNextLine()){
        String line = k.nextLine();
        StringTokenizer st = new StringTokenizer(line);
        int count=0;
        while(st.hasMoreTokens()){
          if(count==1){
            c=st.nextToken();
          }
          if(count==0){
            b = st.nextToken();
            count++;
          }
        }
        long dividend=0;
        long divisor=0;
        long remainder=1;
        long i = Long.parseLong(b);
        long j = Long.parseLong(c);
        if(i>j){
          dividend = i;
          divisor = j;
        }else{
          dividend = j;
          divisor = i;
        }
        while(remainder!=0){         
          remainder = dividend%divisor;
          dividend = divisor;
          
          if(remainder==0){
            break;
          }else{
            divisor = remainder;
          }
        }
        long lcm = (i*j)/divisor;
        System.out.println(divisor+" "+lcm);
        
      }
      
    }finally{
      k.close();
    }
  }
}