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

public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		StringTokenizer to;
		String s;
		while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		}
		System.out.print(builder);
	}

	public static int getGCD(int a, int b) {
		int tmp;
		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		}
		return b;
	}

	public static int getLCM(int a, int b, int GCD) {
		return a / GCD * b;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		StringTokenizer to;
		String s;
		while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		}
		System.out.print(builder);
	}

	public static int getGCD(int a, int b) {
		int tmp;
		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		}
		return b;
	}

	public static int getLCM(int a, int b, int GCD) {
		return a / GCD * b;
	}
} Main public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		StringTokenizer to;
		String s;
		while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		}
		System.out.print(builder);
	} main {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		StringTokenizer to;
		String s;
		while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		}
		System.out.print(builder);
	} BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in)); reader new BufferedReader(new InputStreamReader(
				System.in)) StringBuilder builder = new StringBuilder(); builder new StringBuilder() StringTokenizer to; to String s; s while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		} (s = reader.readLine()) != null (s = reader.readLine()) s reader.readLine() reader.readLine reader null {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		} to = new StringTokenizer(s) to new StringTokenizer(s) int a = Integer.parseInt(to.nextToken()); a Integer.parseInt(to.nextToken()) Integer.parseInt Integer to.nextToken() to.nextToken to int b = Integer.parseInt(to.nextToken()); b Integer.parseInt(to.nextToken()) Integer.parseInt Integer to.nextToken() to.nextToken to int GCD = getGCD(a, b); GCD getGCD(a, b) getGCD a b int LCM = getLCM(a, b, GCD); LCM getLCM(a, b, GCD) getLCM a b GCD builder.append(GCD).append(' ').append(LCM).append('\n') builder.append(GCD).append(' ').append(LCM).append builder.append(GCD).append(' ').append(LCM) builder.append(GCD).append(' ').append builder.append(GCD).append(' ') builder.append(GCD).append builder.append(GCD) builder.append builder GCD ' ' LCM '\n' System.out.print(builder) System.out.print System.out System System.out builder String[] args args public static int getGCD(int a, int b) {
		int tmp;
		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		}
		return b;
	} getGCD {
		int tmp;
		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		}
		return b;
	} int tmp; tmp if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		} a > b a b {
			tmp = a;
			a = b;
			b = tmp;
		} tmp = a tmp a a = b a b b = tmp b tmp while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		} a != 0 a 0 {
			tmp = a;
			a = b % a;
			b = tmp;
		} tmp = a tmp a a = b % a a b % a b a b = tmp b tmp return b; b int a a int b b public static int getLCM(int a, int b, int GCD) {
		return a / GCD * b;
	} getLCM {
		return a / GCD * b;
	} return a / GCD * b; a / GCD * b a / GCD a GCD b int a a int b b int GCD GCD public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		StringTokenizer to;
		String s;
		while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		}
		System.out.print(builder);
	}

	public static int getGCD(int a, int b) {
		int tmp;
		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		}
		return b;
	}

	public static int getLCM(int a, int b, int GCD) {
		return a / GCD * b;
	}
} public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		StringTokenizer to;
		String s;
		while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		}
		System.out.print(builder);
	}

	public static int getGCD(int a, int b) {
		int tmp;
		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		}
		return b;
	}

	public static int getLCM(int a, int b, int GCD) {
		return a / GCD * b;
	}
} Main

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

public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		StringTokenizer to;
		String s;
		while ((s = reader.readLine()) != null) {
			to = new StringTokenizer(s);
			int a = Integer.parseInt(to.nextToken());
			int b = Integer.parseInt(to.nextToken());
			int GCD = getGCD(a, b);
			int LCM = getLCM(a, b, GCD);
			builder.append(GCD).append(' ').append(LCM).append('\n');

		}
		System.out.print(builder);
	}

	public static int getGCD(int a, int b) {
		int tmp;
		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (a != 0) {
			tmp = a;
			a = b % a;
			b = tmp;
		}
		return b;
	}

	public static int getLCM(int a, int b, int GCD) {
		return a / GCD * b;
	}
}