import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws IOException {
		// System.out.println("Hello world");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException {
		// System.out.println("Hello world");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		}
	}

} Main public static void main(String[] args) throws IOException {
		// System.out.println("Hello world");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		}
	} main {
		// System.out.println("Hello world");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		}
	} InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader br = new BufferedReader(is); br new BufferedReader(is) while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		} true {
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		} int n = 2; n 2 String c = br.readLine(); c br.readLine() br.readLine br if(c == null)
			break; c == null c null break; long[] arr = new long[n]; arr new long[n] n for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		} {
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		} if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		} c.indexOf(" ") !=  -1 c.indexOf(" ") c.indexOf c " " -1 1 {
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		} String str = c.substring(0, c.indexOf(" ")); str c.substring(0, c.indexOf(" ")) c.substring c 0 c.indexOf(" ") c.indexOf c " " arr[i] = Long.parseLong(str) arr[i] arr i Long.parseLong(str) Long.parseLong Long str c = c.substring(c.indexOf(" ") + 1) c c.substring(c.indexOf(" ") + 1) c.substring c c.indexOf(" ") + 1 c.indexOf(" ") c.indexOf c " " 1 {
		arr[i] = Long.parseLong(c);
		} arr[i] = Long.parseLong(c) arr[i] arr i Long.parseLong(c) Long.parseLong Long c if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		} arr[1] < arr[0] arr[1] arr 1 arr[0] arr 0 {
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		} long re = arr[1]; re arr[1] arr 1 arr[1] = arr[0] arr[1] arr 1 arr[0] arr 0 arr[0] = re arr[0] arr 0 re long[] arr2 = arr.clone(); arr2 arr.clone() arr.clone arr long amari = 1; amari 1 while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		} arr2[0] !=0 arr2[0] arr2 0 0 {
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		} amari = arr2[1] % arr2[0] amari arr2[1] % arr2[0] arr2[1] arr2 1 arr2[0] arr2 0 if(amari == 0) break; amari == 0 amari 0 break; arr2[1] = arr2[0] arr2[1] arr2 1 arr2[0] arr2 0 arr2[0] = amari arr2[0] arr2 0 amari long i = 1; i 1 while((arr[0]*i) % arr[1] != 0){
			i++;
		} (arr[0]*i) % arr[1] != 0 (arr[0]*i) % arr[1] (arr[0]*i) arr[0] arr 0 i arr[1] arr 1 0 {
			i++;
		} i++ i System.out.println(arr2[0] + " " + arr[0]*i) System.out.println System.out System System.out arr2[0] + " " + arr[0]*i arr2[0] + " " + arr[0]*i arr2[0] arr2 0 " " arr[0]*i arr[0] arr 0 i String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		// System.out.println("Hello world");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		}
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		// System.out.println("Hello world");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		}
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws IOException {
		// System.out.println("Hello world");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while(true){
		
		int n = 2;
		String c = br.readLine();
		
		if(c == null)
			break;
		
		long[] arr = new long[n];
		for(int i = 0; i < n; i++){
		if(c.indexOf(" ") !=  -1){
		String str = c.substring(0, c.indexOf(" "));
		arr[i] = Long.parseLong(str);
		c = c.substring(c.indexOf(" ") + 1);
		}
		else{
		arr[i] = Long.parseLong(c);
		}
		}

		if(arr[1] < arr[0]){
			long re = arr[1];
			arr[1] = arr[0];
			arr[0] = re;
		}
		
		long[] arr2 = arr.clone();
		long amari = 1;
		while(arr2[0] !=0){
			amari = arr2[1] % arr2[0];
			if(amari == 0) break;
			arr2[1] = arr2[0];
			arr2[0] = amari;
		}
		


		long i = 1;
		while((arr[0]*i) % arr[1] != 0){
			i++;
		}
		
		System.out.println(arr2[0] + " " + arr[0]*i);
		
		}
	}

}