import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] a;
		long x,y;
		
		while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		}

	}
	
	public static long kobai(long x, long y){
		long l,s,num;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		num=l;
		while(num%s!=0){
			num=num+l;
		}
		return num;
	}
	
	public static long koyaku(long x, long y){
		long l,s;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		if(l%s==0) return s;
		return koyaku(s,l%s);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] a;
		long x,y;
		
		while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		}

	}
	
	public static long kobai(long x, long y){
		long l,s,num;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		num=l;
		while(num%s!=0){
			num=num+l;
		}
		return num;
	}
	
	public static long koyaku(long x, long y){
		long l,s;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		if(l%s==0) return s;
		return koyaku(s,l%s);
	}

} Main public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] a;
		long x,y;
		
		while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		}

	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] a;
		long x,y;
		
		while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		}

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str=br.readLine(); str br.readLine() br.readLine br String[] a; a long x x y; y while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		} str!=null str null {
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		} a=str.split(" ",0) a str.split(" ",0) str.split str " " 0 x=Integer.parseInt(a[0]) x Integer.parseInt(a[0]) Integer.parseInt Integer a[0] a 0 y=Integer.parseInt(a[1]) y Integer.parseInt(a[1]) Integer.parseInt Integer a[1] a 1 System.out.println(koyaku(x,y)+" "+kobai(x,y)) System.out.println System.out System System.out koyaku(x,y)+" "+kobai(x,y) koyaku(x,y)+" "+kobai(x,y) koyaku(x,y) koyaku x y " " kobai(x,y) kobai x y str=br.readLine() str br.readLine() br.readLine br String[] args args public static long kobai(long x, long y){
		long l,s,num;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		num=l;
		while(num%s!=0){
			num=num+l;
		}
		return num;
	} kobai {
		long l,s,num;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		num=l;
		while(num%s!=0){
			num=num+l;
		}
		return num;
	} long l l s s num; num if(x>=y){l=x;s=y;}
		else{l=y;s=x;} x>=y x y {l=x;s=y;} l=x l x s=y s y {l=y;s=x;} l=y l y s=x s x num=l num l while(num%s!=0){
			num=num+l;
		} num%s!=0 num%s num s 0 {
			num=num+l;
		} num=num+l num num+l num l return num; num long x x long y y public static long koyaku(long x, long y){
		long l,s;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		if(l%s==0) return s;
		return koyaku(s,l%s);
	} koyaku {
		long l,s;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		if(l%s==0) return s;
		return koyaku(s,l%s);
	} long l l s; s if(x>=y){l=x;s=y;}
		else{l=y;s=x;} x>=y x y {l=x;s=y;} l=x l x s=y s y {l=y;s=x;} l=y l y s=x s x if(l%s==0) return s; l%s==0 l%s l s 0 return s; s return koyaku(s,l%s); koyaku(s,l%s) koyaku s l%s l s long x x long y y public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] a;
		long x,y;
		
		while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		}

	}
	
	public static long kobai(long x, long y){
		long l,s,num;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		num=l;
		while(num%s!=0){
			num=num+l;
		}
		return num;
	}
	
	public static long koyaku(long x, long y){
		long l,s;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		if(l%s==0) return s;
		return koyaku(s,l%s);
	}

} public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] a;
		long x,y;
		
		while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		}

	}
	
	public static long kobai(long x, long y){
		long l,s,num;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		num=l;
		while(num%s!=0){
			num=num+l;
		}
		return num;
	}
	
	public static long koyaku(long x, long y){
		long l,s;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		if(l%s==0) return s;
		return koyaku(s,l%s);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] a;
		long x,y;
		
		while(str!=null){
			a=str.split(" ",0);
			x=Integer.parseInt(a[0]);
			y=Integer.parseInt(a[1]);
			System.out.println(koyaku(x,y)+" "+kobai(x,y));
			str=br.readLine();
		}

	}
	
	public static long kobai(long x, long y){
		long l,s,num;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		num=l;
		while(num%s!=0){
			num=num+l;
		}
		return num;
	}
	
	public static long koyaku(long x, long y){
		long l,s;
		if(x>=y){l=x;s=y;}
		else{l=y;s=x;}
		
		if(l%s==0) return s;
		return koyaku(s,l%s);
	}

}