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


public class Main
{

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}

	}
	
	public static long gcd(long a, long b)
	{
		if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a);
	}
	
	public static long lcm(long a, long b)
	{
		long multiple = Math.abs(a*b);
		return multiple/gcd(a,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
{

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}

	}
	
	public static long gcd(long a, long b)
	{
		if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a);
	}
	
	public static long lcm(long a, long b)
	{
		long multiple = Math.abs(a*b);
		return multiple/gcd(a,b);
	}

} Main /**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}

	} main {
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}

	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String line; line while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} (line = in.readLine()) != null (line = in.readLine()) line in.readLine() in.readLine in null {
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} line=line.trim() line line.trim() line.trim line StringTokenizer st = new StringTokenizer(line); st new StringTokenizer(line) long a = Integer.parseInt(st.nextToken()); a Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st long b = Integer.parseInt(st.nextToken()); b Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st System.out.println(gcd(a,b)+" "+lcm(a,b)) System.out.println System.out System System.out gcd(a,b)+" "+lcm(a,b) gcd(a,b)+" "+lcm(a,b) gcd(a,b) gcd a b " " lcm(a,b) lcm a b String[] args args public static long gcd(long a, long b)
	{
		if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a);
	} gcd {
		if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a);
	} if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a); a>=b a b {
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		} while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			} b!=0 b 0 {
				long temp = b;
				b = a % b;
				a = temp;
			} long temp = b; temp b b = a % b b a % b a b a = temp a temp return a; a return gcd(b,a); gcd(b,a) gcd b a long a a long b b public static long lcm(long a, long b)
	{
		long multiple = Math.abs(a*b);
		return multiple/gcd(a,b);
	} lcm {
		long multiple = Math.abs(a*b);
		return multiple/gcd(a,b);
	} long multiple = Math.abs(a*b); multiple Math.abs(a*b) Math.abs Math a*b a b return multiple/gcd(a,b); multiple/gcd(a,b) multiple gcd(a,b) gcd a b long a a long b b public class Main
{

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}

	}
	
	public static long gcd(long a, long b)
	{
		if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a);
	}
	
	public static long lcm(long a, long b)
	{
		long multiple = Math.abs(a*b);
		return multiple/gcd(a,b);
	}

} public class Main
{

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}

	}
	
	public static long gcd(long a, long b)
	{
		if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a);
	}
	
	public static long lcm(long a, long b)
	{
		long multiple = Math.abs(a*b);
		return multiple/gcd(a,b);
	}

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


public class Main
{

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = in.readLine()) != null)
		{
			line=line.trim();
			StringTokenizer st = new StringTokenizer(line);
			long a = Integer.parseInt(st.nextToken());
			long b = Integer.parseInt(st.nextToken());
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}

	}
	
	public static long gcd(long a, long b)
	{
		if (a>=b) 
		{
			while (b!=0) 
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;			

		}
		else return gcd(b,a);
	}
	
	public static long lcm(long a, long b)
	{
		long multiple = Math.abs(a*b);
		return multiple/gcd(a,b);
	}

}