import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        }
    }
 }  import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        }
    }
 } Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        } true {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        } String li; li try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            } catch(Exception e) {
                break;
            } Exception e {
                break;
            } break; {
                li = sc.nextLine();
            } li = sc.nextLine() li sc.nextLine() sc.nextLine sc String[] lisp = li.split(" "); lisp li.split(" ") li.split li " " int a = Integer.parseInt(lisp[0]); a Integer.parseInt(lisp[0]) Integer.parseInt Integer lisp[0] lisp 0 int b = Integer.parseInt(lisp[1]); b Integer.parseInt(lisp[1]) Integer.parseInt Integer lisp[1] lisp 1 int x; x int y; y if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                } a > b a b {
                    x = a;
                    y = b;
                } x = a x a y = b y b {
                    x  = b;
                    y = a;
                } x  = b x b y = a y a while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            } x > 0 && y > 0 x > 0 x 0 y > 0 y 0 {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            } int z = x % y; z x % y x y x = y x y y = z y z if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                } y == 0 y 0 {
                    System.out.println(x + " " + (a / x * b));
                } System.out.println(x + " " + (a / x * b)) System.out.println System.out System System.out x + " " + (a / x * b) x + " " + (a / x * b) x " " (a / x * b) a / x a x b String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        }
    }
 } public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        }
    }
 } Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true) {
            String li;
            try {
                li = sc.nextLine();
            }catch(Exception e) {
                break;
            }
            String[] lisp = li.split(" ");
            int a = Integer.parseInt(lisp[0]);
            int b = Integer.parseInt(lisp[1]);
            int x;
            int y;
            if(a > b) {
                    x = a;
                    y = b;
                }else {
                    x  = b;
                    y = a;
                }
            while(x > 0 && y > 0) {
                int z = x % y;
                x = y;
                y = z;
                if(y == 0) {
                    System.out.println(x + " " + (a / x * b));
                }
            }
        }
    }
 } 
