import java.util.Scanner;

class Main{
    public static int gcd(int a, int b){
        int t;
        if(a < b){
            t = a;
            a = b;
            b = t;
        }
        while(b > 0){
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
        }
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static int gcd(int a, int b){
        int t;
        if(a < b){
            t = a;
            a = b;
            b = t;
        }
        while(b > 0){
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
        }
    }
} Main public static int gcd(int a, int b){
        int t;
        if(a < b){
            t = a;
            a = b;
            b = t;
        }
        while(b > 0){
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    } gcd {
        int t;
        if(a < b){
            t = a;
            a = b;
            b = t;
        }
        while(b > 0){
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    } int t; t if(a < b){
            t = a;
            a = b;
            b = t;
        } a < b a b {
            t = a;
            a = b;
            b = t;
        } t = a t a a = b a b b = t b t while(b > 0){
            t = b;
            b = a % b;
            a = t;
        } b > 0 b 0 {
            t = b;
            b = a % b;
            a = t;
        } t = b t b b = a % b b a % b a b a = t a t return a; a int a a int b b public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
        }
    } main {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
        }
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) while(in.hasNext()){
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
        } in.hasNext() in.hasNext in {
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
        } int a = in.nextInt(); a in.nextInt() in.nextInt in int b = in.nextInt(); b in.nextInt() in.nextInt in System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b) System.out.println System.out System System.out gcd(a, b) + " " + a / gcd(a, b) * b gcd(a, b) + " " + a / gcd(a, b) * b gcd(a, b) gcd a b " " a / gcd(a, b) * b a / gcd(a, b) a gcd(a, b) gcd a b b String[] args args
import java.util.Scanner;

class Main{
    public static int gcd(int a, int b){
        int t;
        if(a < b){
            t = a;
            a = b;
            b = t;
        }
        while(b > 0){
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
        }
    }
}