import java.util.*;

class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                while(sc.hasNext()){
                        int a = sc.nextInt();
                        int b = sc.nextInt();
                        System.out.println(gcd(a,b) + " " + lcm(a,b));
                }   
                sc.close();
        }   
        static int gcd(int a, int b){
                if(a < b){ 
                        int tmp = a;
                        a = b;
                        b = tmp;
                }   
                do{ 
                        int r = a%b;
                        a = b;
                        b = r;
                }while(b != 0); 
                return a;
        }   
        static int lcm(int a, int b){
                int _a = a;
                int _b = b;
                while(_a != _b){
                        if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        }   
                }   
                return _a; 
        }   
} import java.util.*; util.* java class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                while(sc.hasNext()){
                        int a = sc.nextInt();
                        int b = sc.nextInt();
                        System.out.println(gcd(a,b) + " " + lcm(a,b));
                }   
                sc.close();
        }   
        static int gcd(int a, int b){
                if(a < b){ 
                        int tmp = a;
                        a = b;
                        b = tmp;
                }   
                do{ 
                        int r = a%b;
                        a = b;
                        b = r;
                }while(b != 0); 
                return a;
        }   
        static int lcm(int a, int b){
                int _a = a;
                int _b = b;
                while(_a != _b){
                        if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        }   
                }   
                return _a; 
        }   
} Main public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                while(sc.hasNext()){
                        int a = sc.nextInt();
                        int b = sc.nextInt();
                        System.out.println(gcd(a,b) + " " + lcm(a,b));
                }   
                sc.close();
        } main {
                Scanner sc = new Scanner(System.in);
                while(sc.hasNext()){
                        int a = sc.nextInt();
                        int b = sc.nextInt();
                        System.out.println(gcd(a,b) + " " + lcm(a,b));
                }   
                sc.close();
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
                        int a = sc.nextInt();
                        int b = sc.nextInt();
                        System.out.println(gcd(a,b) + " " + lcm(a,b));
                } sc.hasNext() sc.hasNext sc {
                        int a = sc.nextInt();
                        int b = sc.nextInt();
                        System.out.println(gcd(a,b) + " " + lcm(a,b));
                } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc 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 sc.close() sc.close sc String[] args args static int gcd(int a, int b){
                if(a < b){ 
                        int tmp = a;
                        a = b;
                        b = tmp;
                }   
                do{ 
                        int r = a%b;
                        a = b;
                        b = r;
                }while(b != 0); 
                return a;
        } gcd {
                if(a < b){ 
                        int tmp = a;
                        a = b;
                        b = tmp;
                }   
                do{ 
                        int r = a%b;
                        a = b;
                        b = r;
                }while(b != 0); 
                return a;
        } if(a < b){ 
                        int tmp = a;
                        a = b;
                        b = tmp;
                } a < b a b { 
                        int tmp = a;
                        a = b;
                        b = tmp;
                } int tmp = a; tmp a a = b a b b = tmp b tmp do{ 
                        int r = a%b;
                        a = b;
                        b = r;
                }while(b != 0); b != 0 b 0 { 
                        int r = a%b;
                        a = b;
                        b = r;
                } int r = a%b; r a%b a b a = b a b b = r b r return a; a int a a int b b static int lcm(int a, int b){
                int _a = a;
                int _b = b;
                while(_a != _b){
                        if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        }   
                }   
                return _a; 
        } lcm {
                int _a = a;
                int _b = b;
                while(_a != _b){
                        if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        }   
                }   
                return _a; 
        } int _a = a; _a a int _b = b; _b b while(_a != _b){
                        if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        }   
                } _a != _b _a _b {
                        if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        }   
                } if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        } _a < _b _a _b {
                                _a += a;
                        } _a += a _a a {
                                _b += b;
                        } _b += b _b b return _a; _a int a a int b b
import java.util.*;

class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                while(sc.hasNext()){
                        int a = sc.nextInt();
                        int b = sc.nextInt();
                        System.out.println(gcd(a,b) + " " + lcm(a,b));
                }   
                sc.close();
        }   
        static int gcd(int a, int b){
                if(a < b){ 
                        int tmp = a;
                        a = b;
                        b = tmp;
                }   
                do{ 
                        int r = a%b;
                        a = b;
                        b = r;
                }while(b != 0); 
                return a;
        }   
        static int lcm(int a, int b){
                int _a = a;
                int _b = b;
                while(_a != _b){
                        if(_a < _b){
                                _a += a;
                        }else{
                                _b += b;
                        }   
                }   
                return _a; 
        }   
}