import java.io.*;
import java.util.regex.*;

public class Main {
	public static void main(String[] args) throws IOException {
		Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
		String str = "";
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		}
		bf.close();
	}
} import java.io.*; io.* java import java.util.regex.*; regex.* java.util public class Main {
	public static void main(String[] args) throws IOException {
		Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
		String str = "";
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		}
		bf.close();
	}
} Main public static void main(String[] args) throws IOException {
		Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
		String str = "";
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		}
		bf.close();
	} main {
		Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
		String str = "";
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		}
		bf.close();
	} Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)"); pattern Pattern.compile("([0-9]+) *([0-9]+)") Pattern.compile Pattern "([0-9]+) *([0-9]+)" String str = ""; str "" BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); bf new BufferedReader(new InputStreamReader(System.in)) while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		} (str=bf.readLine())!=null (str=bf.readLine()) str bf.readLine() bf.readLine bf null {
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		} Matcher matcher = pattern.matcher(str); matcher pattern.matcher(str) pattern.matcher pattern str if(!matcher.matches())break; !matcher.matches() matcher.matches() matcher.matches matcher break; int a a b b c c d d e e f; f a=c=Integer.parseInt(matcher.group(1)) a c=Integer.parseInt(matcher.group(1)) c Integer.parseInt(matcher.group(1)) Integer.parseInt Integer matcher.group(1) matcher.group matcher 1 b=d=Integer.parseInt(matcher.group(2)) b d=Integer.parseInt(matcher.group(2)) d Integer.parseInt(matcher.group(2)) Integer.parseInt Integer matcher.group(2) matcher.group matcher 2 while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			} (c*d)!=0 (c*d) c d 0 {
				if(c>d)
					c%=d;
				else
					d%=c;
			} if(c>d)
					c%=d;
				else
					d%=c; c>d c d c%=d c d d%=c d c e=c+d e c+d c d f=a/e*b/e*e f a/e*b/e*e a/e*b/e a/e*b a/e a e b e e System.out.println(""+e+" "+f) System.out.println System.out System System.out ""+e+" "+f " " ""+e+" "+f "" e " " f bf.close() bf.close bf String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
		String str = "";
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		}
		bf.close();
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
		String str = "";
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		}
		bf.close();
	}
} Main
import java.io.*;
import java.util.regex.*;

public class Main {
	public static void main(String[] args) throws IOException {
		Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
		String str = "";
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		while((str=bf.readLine())!=null){
			Matcher matcher = pattern.matcher(str);
			if(!matcher.matches())break;
			int a,b,c,d,e,f;
			a=c=Integer.parseInt(matcher.group(1));
			b=d=Integer.parseInt(matcher.group(2));
			while((c*d)!=0){
				if(c>d)
					c%=d;
				else
					d%=c;
			}
			e=c+d;
			f=a/e*b/e*e;
			System.out.println(""+e+" "+f);
		}
		bf.close();
	}
}