import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        while(sc.hasNext()){
            long a = sc.nextLong(),b = sc.nextLong();
            ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
        }
        for(int i = 0,size = ans.size();i < size;i++){
            System.out.println(ans.get(i));
        }
    }
    static long getGCD(long a,long b){
        while(a != b){
            if(a > b) a -= b;
            else b -= a;
        }
        return a;
    }
    static long getLCM(long a,long b){
        return a * b / getGCD(a,b);
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        while(sc.hasNext()){
            long a = sc.nextLong(),b = sc.nextLong();
            ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
        }
        for(int i = 0,size = ans.size();i < size;i++){
            System.out.println(ans.get(i));
        }
    }
    static long getGCD(long a,long b){
        while(a != b){
            if(a > b) a -= b;
            else b -= a;
        }
        return a;
    }
    static long getLCM(long a,long b){
        return a * b / getGCD(a,b);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        while(sc.hasNext()){
            long a = sc.nextLong(),b = sc.nextLong();
            ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
        }
        for(int i = 0,size = ans.size();i < size;i++){
            System.out.println(ans.get(i));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        while(sc.hasNext()){
            long a = sc.nextLong(),b = sc.nextLong();
            ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
        }
        for(int i = 0,size = ans.size();i < size;i++){
            System.out.println(ans.get(i));
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<String> ans = new ArrayList<>(); ans new ArrayList<>() while(sc.hasNext()){
            long a = sc.nextLong(),b = sc.nextLong();
            ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
        } sc.hasNext() sc.hasNext sc {
            long a = sc.nextLong(),b = sc.nextLong();
            ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
        } long a = sc.nextLong() a sc.nextLong() sc.nextLong sc b = sc.nextLong(); b sc.nextLong() sc.nextLong sc ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b))) ans.add ans String.format("%d %d",getGCD(a,b),getLCM(a,b)) String.format String "%d %d" getGCD(a,b) getGCD a b getLCM(a,b) getLCM a b for(int i = 0,size = ans.size();i < size;i++){
            System.out.println(ans.get(i));
        } int i = 0,size = ans.size(); int i = 0 i 0 size = ans.size(); size ans.size() ans.size ans i < size i size i++ i++ i {
            System.out.println(ans.get(i));
        } {
            System.out.println(ans.get(i));
        } System.out.println(ans.get(i)) System.out.println System.out System System.out ans.get(i) ans.get ans i String[] args args static long getGCD(long a,long b){
        while(a != b){
            if(a > b) a -= b;
            else b -= a;
        }
        return a;
    } getGCD {
        while(a != b){
            if(a > b) a -= b;
            else b -= a;
        }
        return a;
    } while(a != b){
            if(a > b) a -= b;
            else b -= a;
        } a != b a b {
            if(a > b) a -= b;
            else b -= a;
        } if(a > b) a -= b;
            else b -= a; a > b a b a -= b a b b -= a b a return a; a long a a long b b static long getLCM(long a,long b){
        return a * b / getGCD(a,b);
    } getLCM {
        return a * b / getGCD(a,b);
    } return a * b / getGCD(a,b); a * b / getGCD(a,b) a * b a b getGCD(a,b) getGCD a b long a a long b b
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        while(sc.hasNext()){
            long a = sc.nextLong(),b = sc.nextLong();
            ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
        }
        for(int i = 0,size = ans.size();i < size;i++){
            System.out.println(ans.get(i));
        }
    }
    static long getGCD(long a,long b){
        while(a != b){
            if(a > b) a -= b;
            else b -= a;
        }
        return a;
    }
    static long getLCM(long a,long b){
        return a * b / getGCD(a,b);
    }
}