import java.util.Scanner;


public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		}
	}
	
	private static long getGCD(long a, long b)
	{
		for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		}
	}
	
	private static long getLCM(long a, long b)
	{
		for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		}
	}
	
	private static long getGCD(long a, long b)
	{
		for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		}
	}
	
	private static long getLCM(long a, long b)
	{
		for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		}
	}
} Main public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		} ; scanner.hasNext() scanner.hasNext scanner {
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		} {
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		} long a = scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner long b = scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			} a < b a b {
				long buf = a;
				a = b;
				b = buf;
			} long buf = a; buf a a = b a b b = buf b buf System.out.println(getGCD(a, b)+" "+getLCM(a, b)) System.out.println System.out System System.out getGCD(a, b)+" "+getLCM(a, b) getGCD(a, b)+" "+getLCM(a, b) getGCD(a, b) getGCD a b " " getLCM(a, b) getLCM a b String[] args args private static long getGCD(long a, long b)
	{
		for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		}
	} getGCD {
		for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		}
	} for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		} ; {
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		} {
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		} if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			} a > b a b {
				a = a % b;
				if(a == 0)
					return b;
			} a = a % b a a % b a b if(a == 0)
					return b; a == 0 a 0 return b; b {
				b = b % a;
				if(b == 0) 
					return a;
			} b = b % a b b % a b a if(b == 0) 
					return a; b == 0 b 0 return a; a long a a long b b private static long getLCM(long a, long b)
	{
		for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		}
	} getLCM {
		for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		}
	} for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		} long n=b; long n=b; n b n+=b n+=b n b {
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		} {
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		} if(n%a==0 && n%b==0)
			{
				return n;
			} n%a==0 && n%b==0 n%a==0 n%a n a 0 n%b==0 n%b n b 0 {
				return n;
			} return n; n long a a long b b public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		}
	}
	
	private static long getGCD(long a, long b)
	{
		for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		}
	}
	
	private static long getLCM(long a, long b)
	{
		for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		}
	}
} public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		}
	}
	
	private static long getGCD(long a, long b)
	{
		for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		}
	}
	
	private static long getLCM(long a, long b)
	{
		for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		}
	}
} Main
import java.util.Scanner;


public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		for(; scanner.hasNext(); )
		{
			long a = scanner.nextLong();
			long b = scanner.nextLong();
			if(a < b)
			{
				long buf = a;
				a = b;
				b = buf;
			}
			
			System.out.println(getGCD(a, b)+" "+getLCM(a, b));
		}
	}
	
	private static long getGCD(long a, long b)
	{
		for(;;)
		{
			if(a > b)
			{
				a = a % b;
				if(a == 0)
					return b;
			}
			else
			{
				b = b % a;
				if(b == 0) 
					return a;
			}
		}
	}
	
	private static long getLCM(long a, long b)
	{
		for(long n=b; ; n+=b)
		{
			if(n%a==0 && n%b==0)
			{
				return n;
			}
		}
	}
}