/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader( new InputStreamReader(System.in) );
		String stdin;
		while( (stdin=br.readLine()) != null )
		{
			String params[] = stdin.split( " " );
			if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			}
		}
	}
	
	public static int gcd( int a, int b )
	{
		return (b==0)? a : gcd(b,a%b);
	}
	public static int lcm( int a, int b )
	{
		return a / gcd(a,b) * b;
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader( new InputStreamReader(System.in) );
		String stdin;
		while( (stdin=br.readLine()) != null )
		{
			String params[] = stdin.split( " " );
			if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			}
		}
	}
	
	public static int gcd( int a, int b )
	{
		return (b==0)? a : gcd(b,a%b);
	}
	public static int lcm( int a, int b )
	{
		return a / gcd(a,b) * b;
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader( new InputStreamReader(System.in) );
		String stdin;
		while( (stdin=br.readLine()) != null )
		{
			String params[] = stdin.split( " " );
			if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			}
		}
	} main {
		BufferedReader br = new BufferedReader( new InputStreamReader(System.in) );
		String stdin;
		while( (stdin=br.readLine()) != null )
		{
			String params[] = stdin.split( " " );
			if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			}
		}
	} BufferedReader br = new BufferedReader( new InputStreamReader(System.in) ); br new BufferedReader( new InputStreamReader(System.in) ) String stdin; stdin while( (stdin=br.readLine()) != null )
		{
			String params[] = stdin.split( " " );
			if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			}
		} (stdin=br.readLine()) != null (stdin=br.readLine()) stdin br.readLine() br.readLine br null {
			String params[] = stdin.split( " " );
			if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			}
		} String params[] = stdin.split( " " ); params stdin.split( " " ) stdin.split stdin " " if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			} params.length >= 2 params.length params params.length 2 {
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			} int a = Integer.parseInt( params[0] ); a Integer.parseInt( params[0] ) Integer.parseInt Integer params[0] params 0 int b = Integer.parseInt( params[1] ); b Integer.parseInt( params[1] ) Integer.parseInt Integer params[1] params 1 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 int gcd( int a, int b )
	{
		return (b==0)? a : gcd(b,a%b);
	} gcd {
		return (b==0)? a : gcd(b,a%b);
	} return (b==0)? a : gcd(b,a%b); (b==0)? a : gcd(b,a%b) (b==0) b 0 a gcd(b,a%b) gcd b a%b a b int a a int b b public static int lcm( int a, int b )
	{
		return a / gcd(a,b) * b;
	} lcm {
		return a / gcd(a,b) * b;
	} return a / gcd(a,b) * b; a / gcd(a,b) * b a / gcd(a,b) a gcd(a,b) gcd a b b int a a int b b
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader( new InputStreamReader(System.in) );
		String stdin;
		while( (stdin=br.readLine()) != null )
		{
			String params[] = stdin.split( " " );
			if( params.length >= 2 )
			{
				int a = Integer.parseInt( params[0] );
				int b = Integer.parseInt( params[1] );
				System.out.println( gcd(a,b) + " " + lcm(a,b) );
			}
		}
	}
	
	public static int gcd( int a, int b )
	{
		return (b==0)? a : gcd(b,a%b);
	}
	public static int lcm( int a, int b )
	{
		return a / gcd(a,b) * b;
	}
}