import java.util.Scanner;


public class Main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		}
		/*



			*/
	}
	
	 private static int gcd(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;

         while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         }
         return m;
     }

     private static int lcm(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;
         return ((m / gcd(m, n) * n));
     }
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		}
		/*



			*/
	}
	
	 private static int gcd(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;

         while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         }
         return m;
     }

     private static int lcm(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;
         return ((m / gcd(m, n) * n));
     }
} Main public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		}
		/*



			*/
	} main {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		}
		/*



			*/
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		} sc.hasNextLine() sc.hasNextLine sc {
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		} String[] s = sc.nextLine().split("[\\s]+"); s sc.nextLine().split("[\\s]+") sc.nextLine().split sc.nextLine() sc.nextLine sc "[\\s]+" int a = Integer.parseInt(s[0]); a Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 int b = Integer.parseInt(s[1]); b Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 int x = gcd(a,b); x gcd(a,b) gcd a b int y = lcm(a,b); y lcm(a,b) lcm a b System.out.println(x +" "+ y) System.out.println System.out System System.out x +" "+ y x +" "+ y x " " y String[] args args private static int gcd(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;

         while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         }
         return m;
     } gcd {
         if ((m == 0) || (n == 0)) return 0;

         while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         }
         return m;
     } if ((m == 0) || (n == 0)) return 0; (m == 0) || (n == 0) (m == 0) m 0 (n == 0) n 0 return 0; 0 while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         } m != n m n {
             if (m > n) m = m - n;
             else n = n - m;
         } if (m > n) m = m - n;
             else n = n - m; m > n m n m = m - n m m - n m n n = n - m n n - m n m return m; m int m m int n n private static int lcm(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;
         return ((m / gcd(m, n) * n));
     } lcm {
         if ((m == 0) || (n == 0)) return 0;
         return ((m / gcd(m, n) * n));
     } if ((m == 0) || (n == 0)) return 0; (m == 0) || (n == 0) (m == 0) m 0 (n == 0) n 0 return 0; 0 return ((m / gcd(m, n) * n)); ((m / gcd(m, n) * n)) m / gcd(m, n) m gcd(m, n) gcd m n n int m m int n n public class Main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		}
		/*



			*/
	}
	
	 private static int gcd(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;

         while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         }
         return m;
     }

     private static int lcm(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;
         return ((m / gcd(m, n) * n));
     }
} public class Main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		}
		/*



			*/
	}
	
	 private static int gcd(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;

         while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         }
         return m;
     }

     private static int lcm(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;
         return ((m / gcd(m, n) * n));
     }
} Main
import java.util.Scanner;


public class Main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine())
		{
			String[] s = sc.nextLine().split("[\\s]+");

			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);

			int x = gcd(a,b);
			int y = lcm(a,b);
			System.out.println(x +" "+ y);
		}
		/*



			*/
	}
	
	 private static int gcd(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;

         while (m != n)
         {
             if (m > n) m = m - n;
             else n = n - m;
         }
         return m;
     }

     private static int lcm(int m, int n)
     {
         if ((m == 0) || (n == 0)) return 0;
         return ((m / gcd(m, n) * n));
     }
}