import java.util.Scanner;

public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        }
    }
    
    public static long lcd(long a, long b) {
        return (a*b)/gcd(a,b);
    }
    
    public static void calc() {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long e = sc.nextInt();
        long f = sc.nextInt();
        
        // x?????????????§£???
        long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e));
        long ax = (k/Math.abs(b)) * a;
        long cx = (k/Math.abs(b)) * c;
        long dx = (k/Math.abs(e)) * d;
        long fx = (k/Math.abs(e)) * f;
        float x;
        if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        }
        
        // y?????????????§£???
        k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d));
        long by = (k/Math.abs(a)) * b;
        long cy = (k/Math.abs(a)) * c;
        long ey = (k/Math.abs(d)) * e;
        long fy = (k/Math.abs(d)) * f;
        float y;
        if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        }
        
        System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y));
    }

    public static long gcd(long a, long b) {
        if (a == b) return a;
        if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        }
    }
    
    public static long lcd(long a, long b) {
        return (a*b)/gcd(a,b);
    }
    
    public static void calc() {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long e = sc.nextInt();
        long f = sc.nextInt();
        
        // x?????????????§£???
        long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e));
        long ax = (k/Math.abs(b)) * a;
        long cx = (k/Math.abs(b)) * c;
        long dx = (k/Math.abs(e)) * d;
        long fx = (k/Math.abs(e)) * f;
        float x;
        if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        }
        
        // y?????????????§£???
        k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d));
        long by = (k/Math.abs(a)) * b;
        long cy = (k/Math.abs(a)) * c;
        long ey = (k/Math.abs(d)) * e;
        long fy = (k/Math.abs(d)) * f;
        float y;
        if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        }
        
        System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y));
    }

    public static long gcd(long a, long b) {
        if (a == b) return a;
        if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        }
    }
} Main public static Scanner sc; sc public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        }
    } main {
        sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        }
    } sc = new Scanner(System.in) sc new Scanner(System.in) while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        } sc.hasNext() sc.hasNext sc {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        } long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc System.out.println(gcd(a, b) + " " + lcd(a, b)) System.out.println System.out System System.out gcd(a, b) + " " + lcd(a, b) gcd(a, b) + " " + lcd(a, b) gcd(a, b) gcd a b " " lcd(a, b) lcd a b String[] args args public static long lcd(long a, long b) {
        return (a*b)/gcd(a,b);
    } lcd {
        return (a*b)/gcd(a,b);
    } return (a*b)/gcd(a,b); (a*b)/gcd(a,b) (a*b) a b gcd(a,b) gcd a b long a a long b b public static void calc() {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long e = sc.nextInt();
        long f = sc.nextInt();
        
        // x?????????????§£???
        long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e));
        long ax = (k/Math.abs(b)) * a;
        long cx = (k/Math.abs(b)) * c;
        long dx = (k/Math.abs(e)) * d;
        long fx = (k/Math.abs(e)) * f;
        float x;
        if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        }
        
        // y?????????????§£???
        k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d));
        long by = (k/Math.abs(a)) * b;
        long cy = (k/Math.abs(a)) * c;
        long ey = (k/Math.abs(d)) * e;
        long fy = (k/Math.abs(d)) * f;
        float y;
        if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        }
        
        System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y));
    } calc {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long e = sc.nextInt();
        long f = sc.nextInt();
        
        // x?????????????§£???
        long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e));
        long ax = (k/Math.abs(b)) * a;
        long cx = (k/Math.abs(b)) * c;
        long dx = (k/Math.abs(e)) * d;
        long fx = (k/Math.abs(e)) * f;
        float x;
        if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        }
        
        // y?????????????§£???
        k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d));
        long by = (k/Math.abs(a)) * b;
        long cy = (k/Math.abs(a)) * c;
        long ey = (k/Math.abs(d)) * e;
        long fy = (k/Math.abs(d)) * f;
        float y;
        if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        }
        
        System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y));
    } long a = sc.nextInt(); a sc.nextInt() sc.nextInt sc long b = sc.nextInt(); b sc.nextInt() sc.nextInt sc long c = sc.nextInt(); c sc.nextInt() sc.nextInt sc long d = sc.nextInt(); d sc.nextInt() sc.nextInt sc long e = sc.nextInt(); e sc.nextInt() sc.nextInt sc long f = sc.nextInt(); f sc.nextInt() sc.nextInt sc long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e)); k Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e)) Math.abs(b)*Math.abs(e) Math.abs(b) Math.abs Math b Math.abs(e) Math.abs Math e gcd(Math.abs(b), Math.abs(e)) gcd Math.abs(b) Math.abs Math b Math.abs(e) Math.abs Math e long ax = (k/Math.abs(b)) * a; ax (k/Math.abs(b)) * a (k/Math.abs(b)) k Math.abs(b) Math.abs Math b a long cx = (k/Math.abs(b)) * c; cx (k/Math.abs(b)) * c (k/Math.abs(b)) k Math.abs(b) Math.abs Math b c long dx = (k/Math.abs(e)) * d; dx (k/Math.abs(e)) * d (k/Math.abs(e)) k Math.abs(e) Math.abs Math e d long fx = (k/Math.abs(e)) * f; fx (k/Math.abs(e)) * f (k/Math.abs(e)) k Math.abs(e) Math.abs Math e f float x; x if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        } b*e >= 0 b*e b e 0 {
            x = (cx-fx)/(ax-dx);
        } x = (cx-fx)/(ax-dx) x (cx-fx)/(ax-dx) (cx-fx) cx fx (ax-dx) ax dx {
            x = (cx+fx)/(ax+dx);
        } x = (cx+fx)/(ax+dx) x (cx+fx)/(ax+dx) (cx+fx) cx fx (ax+dx) ax dx k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d)) k Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d)) Math.abs(a)*Math.abs(d) Math.abs(a) Math.abs Math a Math.abs(d) Math.abs Math d gcd(Math.abs(a), Math.abs(d)) gcd Math.abs(a) Math.abs Math a Math.abs(d) Math.abs Math d long by = (k/Math.abs(a)) * b; by (k/Math.abs(a)) * b (k/Math.abs(a)) k Math.abs(a) Math.abs Math a b long cy = (k/Math.abs(a)) * c; cy (k/Math.abs(a)) * c (k/Math.abs(a)) k Math.abs(a) Math.abs Math a c long ey = (k/Math.abs(d)) * e; ey (k/Math.abs(d)) * e (k/Math.abs(d)) k Math.abs(d) Math.abs Math d e long fy = (k/Math.abs(d)) * f; fy (k/Math.abs(d)) * f (k/Math.abs(d)) k Math.abs(d) Math.abs Math d f float y; y if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        } a*d >= 0 a*d a d 0 {
            y = (cy-fy)/(by-ey);
        } y = (cy-fy)/(by-ey) y (cy-fy)/(by-ey) (cy-fy) cy fy (by-ey) by ey {
            y = (cy+fy)/(by+ey);
        } y = (cy+fy)/(by+ey) y (cy+fy)/(by+ey) (cy+fy) cy fy (by+ey) by ey System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y)) System.out.println System.out System System.out String.format("%.3f",x) + " " + String.format("%.3f",y) String.format("%.3f",x) + " " + String.format("%.3f",y) String.format("%.3f",x) String.format String "%.3f" x " " String.format("%.3f",y) String.format String "%.3f" y public static long gcd(long a, long b) {
        if (a == b) return a;
        if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        }
    } gcd {
        if (a == b) return a;
        if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        }
    } if (a == b) return a; a == b a b return a; a if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        } a > b a b {
            return gcd(a - b, b);
        } return gcd(a - b, b); gcd(a - b, b) gcd a - b a b b {
            return gcd(a, b - a);
        } return gcd(a, b - a); gcd(a, b - a) gcd a b - a b a long a a long b b public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        }
    }
    
    public static long lcd(long a, long b) {
        return (a*b)/gcd(a,b);
    }
    
    public static void calc() {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long e = sc.nextInt();
        long f = sc.nextInt();
        
        // x?????????????§£???
        long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e));
        long ax = (k/Math.abs(b)) * a;
        long cx = (k/Math.abs(b)) * c;
        long dx = (k/Math.abs(e)) * d;
        long fx = (k/Math.abs(e)) * f;
        float x;
        if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        }
        
        // y?????????????§£???
        k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d));
        long by = (k/Math.abs(a)) * b;
        long cy = (k/Math.abs(a)) * c;
        long ey = (k/Math.abs(d)) * e;
        long fy = (k/Math.abs(d)) * f;
        float y;
        if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        }
        
        System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y));
    }

    public static long gcd(long a, long b) {
        if (a == b) return a;
        if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        }
    }
} public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        }
    }
    
    public static long lcd(long a, long b) {
        return (a*b)/gcd(a,b);
    }
    
    public static void calc() {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long e = sc.nextInt();
        long f = sc.nextInt();
        
        // x?????????????§£???
        long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e));
        long ax = (k/Math.abs(b)) * a;
        long cx = (k/Math.abs(b)) * c;
        long dx = (k/Math.abs(e)) * d;
        long fx = (k/Math.abs(e)) * f;
        float x;
        if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        }
        
        // y?????????????§£???
        k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d));
        long by = (k/Math.abs(a)) * b;
        long cy = (k/Math.abs(a)) * c;
        long ey = (k/Math.abs(d)) * e;
        long fy = (k/Math.abs(d)) * f;
        float y;
        if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        }
        
        System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y));
    }

    public static long gcd(long a, long b) {
        if (a == b) return a;
        if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long a = sc.nextLong();
            long b = sc.nextLong();
            System.out.println(gcd(a, b) + " " + lcd(a, b));
        }
    }
    
    public static long lcd(long a, long b) {
        return (a*b)/gcd(a,b);
    }
    
    public static void calc() {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long e = sc.nextInt();
        long f = sc.nextInt();
        
        // x?????????????§£???
        long k = Math.abs(b)*Math.abs(e)/gcd(Math.abs(b), Math.abs(e));
        long ax = (k/Math.abs(b)) * a;
        long cx = (k/Math.abs(b)) * c;
        long dx = (k/Math.abs(e)) * d;
        long fx = (k/Math.abs(e)) * f;
        float x;
        if (b*e >= 0) {
            x = (cx-fx)/(ax-dx);
        } else {
            x = (cx+fx)/(ax+dx);
        }
        
        // y?????????????§£???
        k = Math.abs(a)*Math.abs(d)/gcd(Math.abs(a), Math.abs(d));
        long by = (k/Math.abs(a)) * b;
        long cy = (k/Math.abs(a)) * c;
        long ey = (k/Math.abs(d)) * e;
        long fy = (k/Math.abs(d)) * f;
        float y;
        if (a*d >= 0) {
            y = (cy-fy)/(by-ey);
        } else {
            y = (cy+fy)/(by+ey);
        }
        
        System.out.println(String.format("%.3f",x) + " " + String.format("%.3f",y));
    }

    public static long gcd(long a, long b) {
        if (a == b) return a;
        if (a > b) {
            return gcd(a - b, b);
        } else {
            return gcd(a, b - a);
        }
    }
}