import java.io.*;

class Main {
	public static void main(String args[]) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			int a[] = new int[2];
			int c;
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			}

		}
		catch(IOException e) {
			System.out.println(e);
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String args[]) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			int a[] = new int[2];
			int c;
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			}

		}
		catch(IOException e) {
			System.out.println(e);
		}
	}
} Main public static void main(String args[]) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			int a[] = new int[2];
			int c;
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			}

		}
		catch(IOException e) {
			System.out.println(e);
		}
	} main {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			int a[] = new int[2];
			int c;
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			}

		}
		catch(IOException e) {
			System.out.println(e);
		}
	} try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			int a[] = new int[2];
			int c;
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			}

		}
		catch(IOException e) {
			System.out.println(e);
		} catch(IOException e) {
			System.out.println(e);
		} IOException e {
			System.out.println(e);
		} System.out.println(e) System.out.println System.out System System.out e {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			int a[] = new int[2];
			int c;
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			}

		} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String t[] t s; s int a[] = new int[2]; a new int[2] 2 int c; c while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			} (s = reader.readLine())  != null (s = reader.readLine()) s reader.readLine() reader.readLine reader null {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			} t = s.split(" ") t s.split(" ") s.split s " " for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
					a[i] = Integer.parseInt(t[i]);
				} {
					a[i] = Integer.parseInt(t[i]);
				} a[i] = Integer.parseInt(t[i]) a[i] a i Integer.parseInt(t[i]) Integer.parseInt Integer t[i] t i int a0_tmp = a[0] a0_tmp a[0] a 0 a1_tmp = a[1]; a1_tmp a[1] a 1 while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				} true {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				} c = a0_tmp % a1_tmp c a0_tmp % a1_tmp a0_tmp a1_tmp if(c == 0)
						break; c == 0 c 0 break; a0_tmp = a1_tmp a0_tmp a1_tmp a1_tmp = c a1_tmp c System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]) System.out.printf System.out System System.out "%d %d\n" a1_tmp a[0]/a1_tmp*a[1] a[0]/a1_tmp a[0] a 0 a1_tmp a[1] a 1 String args[] args
import java.io.*;

class Main {
	public static void main(String args[]) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			int a[] = new int[2];
			int c;
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Integer.parseInt(t[i]);
				}
				int a0_tmp = a[0], a1_tmp = a[1];
				while(true) {
					c = a0_tmp % a1_tmp;
					if(c == 0)
						break;
					a0_tmp = a1_tmp;
					a1_tmp = c;
				}
				System.out.printf("%d %d\n", a1_tmp, a[0]/a1_tmp*a[1]);

			}

		}
		catch(IOException e) {
			System.out.println(e);
		}
	}
}