import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int[] a = new int[2];
        while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        }
        
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int[] a = new int[2];
        while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        }
        
    }
} Main public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int[] a = new int[2];
        while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        }
        
    } main {
        Scanner s = new Scanner(System.in);
        int[] a = new int[2];
        while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        }
        
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int[] a = new int[2]; a new int[2] 2 while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        } s.hasNext() s.hasNext s {
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        } for(int i=0; i < 2; i++)
                a[i] = s.nextInt(); int i=0; int i=0; i 0 i < 2 i 2 i++ i++ i a[i] = s.nextInt(); a[i] = s.nextInt() a[i] a i s.nextInt() s.nextInt s int gcd = 1; gcd 1 Arrays.sort(a) Arrays.sort Arrays a for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            } int j=2; int j=2; j 2 j<=a[0] j a[0] a 0 j++ j++ j {
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            } {
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            } if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j; (a[0]%j == 0) && (a[1]%j == 0) (a[0]%j == 0) a[0]%j a[0] a 0 j 0 (a[1]%j == 0) a[1]%j a[1] a 1 j 0 gcd = j gcd j int lcm =a[1]; lcm a[1] a 1 int k = 1; k 1 boolean b = true; b true while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            } b {
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            } if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                } (gcd*k)%a[0]==0 && (gcd*k)%a[1]==0 (gcd*k)%a[0]==0 (gcd*k)%a[0] (gcd*k) gcd k a[0] a 0 0 (gcd*k)%a[1]==0 (gcd*k)%a[1] (gcd*k) gcd k a[1] a 1 0 {
                    lcm = gcd*k;
                    b = false;
                } lcm = gcd*k lcm gcd*k gcd k b = false b false k++ k System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm String[] args args public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int[] a = new int[2];
        while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        }
        
    }
} public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int[] a = new int[2];
        while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        }
        
    }
} Main
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int[] a = new int[2];
        while(s.hasNext()){
            for(int i=0; i < 2; i++)
                a[i] = s.nextInt();
            int gcd = 1;
            Arrays.sort(a);
            for(int j=2; j<=a[0];j++){
                if ((a[0]%j == 0) && (a[1]%j == 0))
                    gcd = j;               
            }
            int lcm =a[1];
            int k = 1;
            boolean b = true;
            
            while(b){
                if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
                    lcm = gcd*k;
                    b = false;
                }
                k++;
            }
            System.out.println(gcd + " " + lcm);
        }
        
    }
}