import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int x;
        int y;

        int a = 0;
        int b = 0;
        int c = 0;
 
        while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        }
    }
} import java.util.*; util.* java import java.math.*; math.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int x;
        int y;

        int a = 0;
        int b = 0;
        int c = 0;
 
        while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int x;
        int y;

        int a = 0;
        int b = 0;
        int c = 0;
 
        while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int x;
        int y;

        int a = 0;
        int b = 0;
        int c = 0;
 
        while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x; x int y; y int a = 0; a 0 int b = 0; b 0 int c = 0; c 0 while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        } sc.hasNext() sc.hasNext sc {
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        } x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc a = x a x b = y b y while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            } a != b a b {
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            } if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                } a >= b a b {
                    c = a;
                    a = b;
                    b = c - b;
                } c = a c a a = b a b b = c - b b c - b c b {
                    b = b - a;
                } b = b - a b b - a b a System.out.print(a) System.out.print System.out System System.out a System.out.print(" ") System.out.print System.out System System.out " " System.out.println((x/a)*y) System.out.println System.out System System.out (x/a)*y (x/a) x a y String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int x;
        int y;

        int a = 0;
        int b = 0;
        int c = 0;
 
        while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int x;
        int y;

        int a = 0;
        int b = 0;
        int c = 0;
 
        while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        }
    }
} Main
import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int x;
        int y;

        int a = 0;
        int b = 0;
        int c = 0;
 
        while(sc.hasNext()){
 
            x = sc.nextInt();
            y = sc.nextInt();

            a = x;
            b = y;

            while(a != b){
                if(a >= b){
                    c = a;
                    a = b;
                    b = c - b;
                }else{
                    b = b - a;
                }
            }
            System.out.print(a);
            System.out.print(" ");
            System.out.println((x/a)*y); 
        }
    }
}