import java.util.Scanner;

public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;

	private void mainrun() {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	}

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;

	private void mainrun() {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	}

} Main private Scanner scan; scan public static void main(String args[]){
		new Main().mainrun();
	} main {
		new Main().mainrun();
	} new Main().mainrun() new Main().mainrun new Main() String args[] args private void mainrun() {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	} mainrun {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	} scan = new Scanner(System.in) scan new Scanner(System.in) long a a b b ans ans n n ax ax bx; bx while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		} scan.hasNext() scan.hasNext scan {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		} a = scan.nextInt() a scan.nextInt() scan.nextInt scan b = scan.nextInt() b scan.nextInt() scan.nextInt scan ans = 1 ans 1 n = Math.min(a, b) n Math.min(a, b) Math.min Math a b for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			} long i = 1; long i = 1; i 1 i <= n i n i++ i++ i {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			} {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			} if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				} a % (n/i) == 0 && b % (n/i) == 0 a % (n/i) == 0 a % (n/i) a (n/i) n i 0 b % (n/i) == 0 b % (n/i) b (n/i) n i 0 {
					ans = n/i;
					break;
				} ans = n/i ans n/i n i break; ax = bx = 1 ax bx = 1 bx 1 while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			} true {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			} if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				} a * ax == b * bx a * ax a ax b * bx b bx {
					break;
				} break; if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				} a * ax > b * bx a * ax a ax b * bx b bx {
					bx++;
				} bx++ bx if(a * ax < b * bx){
					ax++;
				} a * ax < b * bx a * ax a ax b * bx b bx {
					ax++;
				} ax++ ax System.out.println(ans + " " + a * ax) System.out.println System.out System System.out ans + " " + a * ax ans + " " + a * ax ans " " a * ax a ax scan.close() scan.close scan public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;

	private void mainrun() {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	}

} public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;

	private void mainrun() {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	}

} Main
import java.util.Scanner;

public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;

	private void mainrun() {
		scan = new Scanner(System.in);

		long a,b,ans,n,ax,bx;

		while(scan.hasNext()) {
			a = scan.nextInt();
			b = scan.nextInt();


			//最大公約数
			ans = 1;
			n = Math.min(a, b);

			for(long i = 1;i <= n;i++) {


				if(a % (n/i) == 0 && b % (n/i) == 0) {
					ans = n/i;
					break;
				}
			}

			//最小公倍数

			ax = bx = 1;

			while(true) {
				if(a * ax == b * bx) {
					break;
				}else if(a * ax > b * bx){
					bx++;
				}else if(a * ax < b * bx){
					ax++;
				}
			}
			System.out.println(ans + " " + a * ax);
		}

		scan.close();

	}

}
