import java.util.Scanner;
public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	long a, b;
	String[] input;
	while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	}
    }
    static long solveGCD (long a, long b) {
	long gcd = a % b;
	if (gcd == 0) {
	    return b;
	}
	return solveGCD(b, gcd);
    }

    static long solveLCM (long a, long b) {
	if (a == 0 || b == 0) {
	    return 0;
	}
	return a * b / solveGCD(a,b);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	long a, b;
	String[] input;
	while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	}
    }
    static long solveGCD (long a, long b) {
	long gcd = a % b;
	if (gcd == 0) {
	    return b;
	}
	return solveGCD(b, gcd);
    }

    static long solveLCM (long a, long b) {
	if (a == 0 || b == 0) {
	    return 0;
	}
	return a * b / solveGCD(a,b);
    }
} Main public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	long a, b;
	String[] input;
	while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	}
    } main {
	Scanner scan = new Scanner(System.in);
	long a, b;
	String[] input;
	while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	}
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long a a b; b String[] input; input while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	} scan.hasNext() scan.hasNext scan {
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	} input = scan.nextLine().split(" ") input scan.nextLine().split(" ") scan.nextLine().split scan.nextLine() scan.nextLine scan " " a = Integer.parseInt(input[0]) a Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 b = Integer.parseInt(input[1]) b Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 long lcm = solveLCM(a, b); lcm solveLCM(a, b) solveLCM a b long gcd = solveGCD(a, b); gcd solveGCD(a, b) solveGCD a b System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm String[] args args static long solveGCD (long a, long b) {
	long gcd = a % b;
	if (gcd == 0) {
	    return b;
	}
	return solveGCD(b, gcd);
    } solveGCD {
	long gcd = a % b;
	if (gcd == 0) {
	    return b;
	}
	return solveGCD(b, gcd);
    } long gcd = a % b; gcd a % b a b if (gcd == 0) {
	    return b;
	} gcd == 0 gcd 0 {
	    return b;
	} return b; b return solveGCD(b, gcd); solveGCD(b, gcd) solveGCD b gcd long a a long b b static long solveLCM (long a, long b) {
	if (a == 0 || b == 0) {
	    return 0;
	}
	return a * b / solveGCD(a,b);
    } solveLCM {
	if (a == 0 || b == 0) {
	    return 0;
	}
	return a * b / solveGCD(a,b);
    } if (a == 0 || b == 0) {
	    return 0;
	} a == 0 || b == 0 a == 0 a 0 b == 0 b 0 {
	    return 0;
	} return 0; 0 return a * b / solveGCD(a,b); a * b / solveGCD(a,b) a * b a b solveGCD(a,b) solveGCD a b long a a long b b public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	long a, b;
	String[] input;
	while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	}
    }
    static long solveGCD (long a, long b) {
	long gcd = a % b;
	if (gcd == 0) {
	    return b;
	}
	return solveGCD(b, gcd);
    }

    static long solveLCM (long a, long b) {
	if (a == 0 || b == 0) {
	    return 0;
	}
	return a * b / solveGCD(a,b);
    }
} public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	long a, b;
	String[] input;
	while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	}
    }
    static long solveGCD (long a, long b) {
	long gcd = a % b;
	if (gcd == 0) {
	    return b;
	}
	return solveGCD(b, gcd);
    }

    static long solveLCM (long a, long b) {
	if (a == 0 || b == 0) {
	    return 0;
	}
	return a * b / solveGCD(a,b);
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	long a, b;
	String[] input;
	while (scan.hasNext()){
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    long lcm = solveLCM(a, b);
	    long gcd = solveGCD(a, b);
	    System.out.println(gcd + " " + lcm);
	}
    }
    static long solveGCD (long a, long b) {
	long gcd = a % b;
	if (gcd == 0) {
	    return b;
	}
	return solveGCD(b, gcd);
    }

    static long solveLCM (long a, long b) {
	if (a == 0 || b == 0) {
	    return 0;
	}
	return a * b / solveGCD(a,b);
    }
}