import java.awt.Frame;
import java.awt.image.SinglePixelPackedSampleModel;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

import javax.print.attribute.standard.Chromaticity;
import javax.sql.rowset.FilteredRowSet;
import javax.swing.BorderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.stream.events.EndDocument;
import javax.xml.transform.Templates;

import java.math.BigInteger;
import java.time.chrono.MinguoChronology;
import java.util.Scanner;

public class Main {
  static InputReader in;
  static PrintWriter out;
  
  static class Solution {
    void solve() throws IOException {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    }
    
    int gcd(int x, int y) {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    }
    
    long lcm(int x, int y) {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    }
//  End solution
  } 
  

  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}

  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;
    
    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }
   
    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }
    
    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    }
    
    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }
    
    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }
    
  }
  
} import java.awt.Frame; Frame java.awt import java.awt.image.SinglePixelPackedSampleModel; SinglePixelPackedSampleModel java.awt.image import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.OutputStream; OutputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.StringTokenizer; StringTokenizer java.util import javax.print.attribute.standard.Chromaticity; Chromaticity javax.print.attribute.standard import javax.sql.rowset.FilteredRowSet; FilteredRowSet javax.sql.rowset import javax.swing.BorderFactory; BorderFactory javax.swing import javax.xml.parsers.DocumentBuilder; DocumentBuilder javax.xml.parsers import javax.xml.stream.events.EndDocument; EndDocument javax.xml.stream.events import javax.xml.transform.Templates; Templates javax.xml.transform import java.math.BigInteger; BigInteger java.math import java.time.chrono.MinguoChronology; MinguoChronology java.time.chrono import java.util.Scanner; Scanner java.util public class Main {
  static InputReader in;
  static PrintWriter out;
  
  static class Solution {
    void solve() throws IOException {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    }
    
    int gcd(int x, int y) {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    }
    
    long lcm(int x, int y) {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    }
//  End solution
  } 
  

  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}

  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;
    
    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }
   
    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }
    
    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    }
    
    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }
    
    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }
    
  }
  
} Main static InputReader in; in static PrintWriter out; out public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
} main {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
} in = new InputReader(System.in) in new InputReader(System.in) out = new PrintWriter(System.out) out new PrintWriter(System.out) Solution solver = new Solution(); solver new Solution() solver.solve() solver.solve solver out.close() out.close out String[] args args static class Solution {
    void solve() throws IOException {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    }
    
    int gcd(int x, int y) {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    }
    
    long lcm(int x, int y) {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    }
//  End solution
  } Solution void solve() throws IOException {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    } solve {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      } sc.hasNext() sc.hasNext sc {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      } int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc out.println(gcd(x, y) + " " + lcm(x, y)) out.println out gcd(x, y) + " " + lcm(x, y) gcd(x, y) + " " + lcm(x, y) gcd(x, y) gcd x y " " lcm(x, y) lcm x y int gcd(int x, int y) {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    } gcd {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    } if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      } x < y x y {
        int tmp = x;
        x = y;
        y = tmp;
      } int tmp = x; tmp x x = y x y y = tmp y tmp while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      } y > 0 y 0 {
        int r = x % y;
        x = y;
        y = r;
      } int r = x % y; r x % y x y x = y x y y = r y r return x; x int x x int y y long lcm(int x, int y) {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    } lcm {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    } if (x == 0 || y == 0) {
        return 0;
      } x == 0 || y == 0 x == 0 x 0 y == 0 y 0 {
        return 0;
      } return 0; 0 long lcm = x *( y / gcd(x, y)); lcm x *( y / gcd(x, y)) x ( y / gcd(x, y)) y gcd(x, y) gcd x y return lcm; lcm int x x int y y static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;
    
    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }
   
    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }
    
    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    }
    
    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }
    
    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }
    
  } InputReader public BufferedReader br; br public StringTokenizer st; st public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    } InputReader {
      br = new BufferedReader(new InputStreamReader(stream));
    } br = new BufferedReader(new InputStreamReader(stream)) br new BufferedReader(new InputStreamReader(stream)) InputStream stream stream public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    } nextInt {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return Integer.parseInt(st.nextToken()); Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    } nextLong {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return Long.parseLong(st.nextToken()); Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    } next {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    } nextDouble {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return Double.parseDouble(st.nextToken()); Double.parseDouble(st.nextToken()) Double.parseDouble Double st.nextToken() st.nextToken st public class Main {
  static InputReader in;
  static PrintWriter out;
  
  static class Solution {
    void solve() throws IOException {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    }
    
    int gcd(int x, int y) {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    }
    
    long lcm(int x, int y) {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    }
//  End solution
  } 
  

  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}

  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;
    
    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }
   
    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }
    
    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    }
    
    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }
    
    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }
    
  }
  
} public class Main {
  static InputReader in;
  static PrintWriter out;
  
  static class Solution {
    void solve() throws IOException {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    }
    
    int gcd(int x, int y) {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    }
    
    long lcm(int x, int y) {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    }
//  End solution
  } 
  

  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}

  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;
    
    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }
   
    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }
    
    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    }
    
    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }
    
    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }
    
  }
  
} Main
import java.awt.Frame;
import java.awt.image.SinglePixelPackedSampleModel;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

import javax.print.attribute.standard.Chromaticity;
import javax.sql.rowset.FilteredRowSet;
import javax.swing.BorderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.stream.events.EndDocument;
import javax.xml.transform.Templates;

import java.math.BigInteger;
import java.time.chrono.MinguoChronology;
import java.util.Scanner;

public class Main {
  static InputReader in;
  static PrintWriter out;
  
  static class Solution {
    void solve() throws IOException {
      Scanner sc = new Scanner(System.in);
      while (sc.hasNext()) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        
        out.println(gcd(x, y) + " " + lcm(x, y));
      }
//      End solve()
    }
    
    int gcd(int x, int y) {
      if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
      }
   
      while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
      }
      return x;
    }
    
    long lcm(int x, int y) {
      if (x == 0 || y == 0) {
        return 0;
      }
      long lcm = x *( y / gcd(x, y));
      
      return lcm;
    }
//  End solution
  } 
  

  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}

  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;
    
    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }
   
    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }
    
    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    }
    
    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }
    
    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }
    
  }
  
}