import java.util.Scanner;

public class Main
{
	static Scanner in;
	static long gcd(long p,long q)
	{
		if(p<q){long t=p;p=q;q=t;}
		if(q==0)return p;
		return gcd(q,p%q);
	}
	static long lcm(long p,long q)
	{
		return p*q/gcd(p,q);
	}
	public static void main(String[] args)
	{
		in=new Scanner(System.in);

		while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		}
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	static Scanner in;
	static long gcd(long p,long q)
	{
		if(p<q){long t=p;p=q;q=t;}
		if(q==0)return p;
		return gcd(q,p%q);
	}
	static long lcm(long p,long q)
	{
		return p*q/gcd(p,q);
	}
	public static void main(String[] args)
	{
		in=new Scanner(System.in);

		while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		}
	}
} Main static Scanner in; in static long gcd(long p,long q)
	{
		if(p<q){long t=p;p=q;q=t;}
		if(q==0)return p;
		return gcd(q,p%q);
	} gcd {
		if(p<q){long t=p;p=q;q=t;}
		if(q==0)return p;
		return gcd(q,p%q);
	} if(p<q){long t=p;p=q;q=t;} p<q p q {long t=p;p=q;q=t;} long t=p; t p p=q p q q=t q t if(q==0)return p; q==0 q 0 return p; p return gcd(q,p%q); gcd(q,p%q) gcd q p%q p q long p p long q q static long lcm(long p,long q)
	{
		return p*q/gcd(p,q);
	} lcm {
		return p*q/gcd(p,q);
	} return p*q/gcd(p,q); p*q/gcd(p,q) p*q p q gcd(p,q) gcd p q long p p long q q public static void main(String[] args)
	{
		in=new Scanner(System.in);

		while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		}
	} main {
		in=new Scanner(System.in);

		while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		}
	} in=new Scanner(System.in) in new Scanner(System.in) while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		} in.hasNext() in.hasNext in {
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		} long n n m; m n=in.nextLong() n in.nextLong() in.nextLong in m=in.nextLong() m in.nextLong() in.nextLong in System.out.println(gcd(n,m)+" "+lcm(n,m)) System.out.println System.out System System.out gcd(n,m)+" "+lcm(n,m) gcd(n,m)+" "+lcm(n,m) gcd(n,m) gcd n m " " lcm(n,m) lcm n m String[] args args public class Main
{
	static Scanner in;
	static long gcd(long p,long q)
	{
		if(p<q){long t=p;p=q;q=t;}
		if(q==0)return p;
		return gcd(q,p%q);
	}
	static long lcm(long p,long q)
	{
		return p*q/gcd(p,q);
	}
	public static void main(String[] args)
	{
		in=new Scanner(System.in);

		while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		}
	}
} public class Main
{
	static Scanner in;
	static long gcd(long p,long q)
	{
		if(p<q){long t=p;p=q;q=t;}
		if(q==0)return p;
		return gcd(q,p%q);
	}
	static long lcm(long p,long q)
	{
		return p*q/gcd(p,q);
	}
	public static void main(String[] args)
	{
		in=new Scanner(System.in);

		while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		}
	}
} Main
import java.util.Scanner;

public class Main
{
	static Scanner in;
	static long gcd(long p,long q)
	{
		if(p<q){long t=p;p=q;q=t;}
		if(q==0)return p;
		return gcd(q,p%q);
	}
	static long lcm(long p,long q)
	{
		return p*q/gcd(p,q);
	}
	public static void main(String[] args)
	{
		in=new Scanner(System.in);

		while(in.hasNext())
		{
		    long n,m;
			n=in.nextLong();m=in.nextLong();
		    System.out.println(gcd(n,m)+" "+lcm(n,m));
		}
	}
}