import java.io.*;
import java.util.Scanner;

public class Main{
	public static long calculateGCD(long x, long y){
		if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		}
		if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		}
	}
	
	public static long calculateLCM(long x, long y){
		return x*y/calculateGCD(x, y);
	}
			
	public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		long[][] result = new long[100][2];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	}
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util public class Main{
	public static long calculateGCD(long x, long y){
		if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		}
		if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		}
	}
	
	public static long calculateLCM(long x, long y){
		return x*y/calculateGCD(x, y);
	}
			
	public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		long[][] result = new long[100][2];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	}
} Main public static long calculateGCD(long x, long y){
		if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		}
		if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		}
	} calculateGCD {
		if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		}
		if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		}
	} if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		} y > x y x {
			long temp = x;
			x = y;
			y = temp;
		} long temp = x; temp x x = y x y y = temp y temp if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		} y == 0 y 0 {
			return x;
		} return x; x {
			return calculateGCD(x-y, y);
		} return calculateGCD(x-y, y); calculateGCD(x-y, y) calculateGCD x-y x y y long x x long y y public static long calculateLCM(long x, long y){
		return x*y/calculateGCD(x, y);
	} calculateLCM {
		return x*y/calculateGCD(x, y);
	} return x*y/calculateGCD(x, y); x*y/calculateGCD(x, y) x*y x y calculateGCD(x, y) calculateGCD x y long x x long y y public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		long[][] result = new long[100][2];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	} main {
		Scanner stdIn = null;
		long[][] result = new long[100][2];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	} Scanner stdIn = null; stdIn null long[][] result = new long[100][2]; result new long[100][2] 100 2 int index = 0; index 0 try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		} {
			if( stdIn != null ){
				stdIn.close();
			}
		} if( stdIn != null ){
				stdIn.close();
			} stdIn != null stdIn null {
				stdIn.close();
			} stdIn.close() stdIn.close stdIn {
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in))) stdIn new Scanner(new BufferedReader(new InputStreamReader(System.in))) long x = 0; x 0 long y = 0; y 0 while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			} stdIn.hasNext() stdIn.hasNext stdIn {
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			} if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				} stdIn.hasNextInt() stdIn.hasNextInt stdIn {
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} x = stdIn.nextInt() x stdIn.nextInt() stdIn.nextInt stdIn y = stdIn.nextInt() y stdIn.nextInt() stdIn.nextInt stdIn {
					stdIn.next();
				} stdIn.next() stdIn.next stdIn result[index][0] = calculateGCD(x, y) result[index][0] result[index] result index 0 calculateGCD(x, y) calculateGCD x y result[index][1] = calculateLCM(x, y) result[index][1] result[index] result index 1 calculateLCM(x, y) calculateLCM x y index++ index for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			} int i = 0; int i = 0; i 0 i < index i index i++ i++ i {
				System.out.println(result[i][0] + " " + result[i][1]);
			} {
				System.out.println(result[i][0] + " " + result[i][1]);
			} System.out.println(result[i][0] + " " + result[i][1]) System.out.println System.out System System.out result[i][0] + " " + result[i][1] result[i][0] + " " + result[i][1] result[i][0] result[i] result i 0 " " result[i][1] result[i] result i 1 String[] args args public class Main{
	public static long calculateGCD(long x, long y){
		if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		}
		if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		}
	}
	
	public static long calculateLCM(long x, long y){
		return x*y/calculateGCD(x, y);
	}
			
	public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		long[][] result = new long[100][2];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	}
} public class Main{
	public static long calculateGCD(long x, long y){
		if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		}
		if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		}
	}
	
	public static long calculateLCM(long x, long y){
		return x*y/calculateGCD(x, y);
	}
			
	public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		long[][] result = new long[100][2];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	}
} Main
import java.io.*;
import java.util.Scanner;

public class Main{
	public static long calculateGCD(long x, long y){
		if( y > x ){
			long temp = x;
			x = y;
			y = temp;
		}
		if( y == 0 ){
			return x;
		} else {
			return calculateGCD(x-y, y);
		}
	}
	
	public static long calculateLCM(long x, long y){
		return x*y/calculateGCD(x, y);
	}
			
	public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		long[][] result = new long[100][2];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			long x = 0;
			long y = 0;
			while( stdIn.hasNext() ){
				if( stdIn.hasNextInt() ){
					x = stdIn.nextInt();
					y = stdIn.nextInt();
				} else {
					stdIn.next();
				}
				
				result[index][0] = calculateGCD(x, y);
				result[index][1] = calculateLCM(x, y);
				index++;
			}
			
			for(int i = 0; i < index; i++){
				System.out.println(result[i][0] + " " + result[i][1]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	}
}