import java.util.Scanner;

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

public class Main {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            long a = in.nextLong();
            long b = in.nextLong();
            System.out.println("" + gcd(a,b) + " " + lcm(a,b));
        }
    }
    static long gcd(long a, long b){
        return b!=0 ? gcd(b,a%b) : a;
    }
    static long lcm(long a, long b){
        return a/gcd(a,b)*b;
    }
}