import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	}
	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		}
//		System.out.println(getGCD(8, 6));;
//		System.out.println(getGCD(50000000, 30000000));;
//		System.out.println(getGCD(3, 1));;
	}
	
	//a >= b
	public static long getGCD(long a, long b){
		long ta = a, tb = b;
		while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		}
		
		return ta;
	}
	
	//a >= b
	public static long getLCM(long a, long b){
		long p, q, r;
		p = a;
		q = b;
		r = b;
		long tmp;
		do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0);
		
		return tmp;
	}

} import java.util.Scanner; Scanner java.util public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	}
	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		}
//		System.out.println(getGCD(8, 6));;
//		System.out.println(getGCD(50000000, 30000000));;
//		System.out.println(getGCD(3, 1));;
	}
	
	//a >= b
	public static long getGCD(long a, long b){
		long ta = a, tb = b;
		while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		}
		
		return ta;
	}
	
	//a >= b
	public static long getLCM(long a, long b){
		long p, q, r;
		p = a;
		q = b;
		r = b;
		long tmp;
		do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0);
		
		return tmp;
	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	} main {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	} doIt() doIt String[] args args public static void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		}
//		System.out.println(getGCD(8, 6));;
//		System.out.println(getGCD(50000000, 30000000));;
//		System.out.println(getGCD(3, 1));;
	} doIt {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		}
//		System.out.println(getGCD(8, 6));;
//		System.out.println(getGCD(50000000, 30000000));;
//		System.out.println(getGCD(3, 1));;
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		} sc.hasNext() sc.hasNext sc {
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		} long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc System.out.println(getLCM(a, b) + " " + getGCD(a, b)) System.out.println System.out System System.out getLCM(a, b) + " " + getGCD(a, b) getLCM(a, b) + " " + getGCD(a, b) getLCM(a, b) getLCM a b " " getGCD(a, b) getGCD a b //a >= b
	public static long getGCD(long a, long b){
		long ta = a, tb = b;
		while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		}
		
		return ta;
	} getGCD {
		long ta = a, tb = b;
		while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		}
		
		return ta;
	} long ta = a ta a tb = b; tb b while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		} true {
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		} if(ta == tb){
				break;
			} ta == tb ta tb {
				break;
			} break; while(ta > tb){
				tb += b;
			} ta > tb ta tb {
				tb += b;
			} tb += b tb b while(tb > ta){
				ta += a;
			} tb > ta tb ta {
				ta += a;
			} ta += a ta a return ta; ta long a a long b b //a >= b
	public static long getLCM(long a, long b){
		long p, q, r;
		p = a;
		q = b;
		r = b;
		long tmp;
		do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0);
		
		return tmp;
	} getLCM {
		long p, q, r;
		p = a;
		q = b;
		r = b;
		long tmp;
		do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0);
		
		return tmp;
	} long p p q q r; r p = a p a q = b q b r = b r b long tmp; tmp do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0); r != 0 r 0 {
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		} tmp = r tmp r r = p % q r p % q p q p = q p q q = r q r return tmp; tmp long a a long b b public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	}
	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		}
//		System.out.println(getGCD(8, 6));;
//		System.out.println(getGCD(50000000, 30000000));;
//		System.out.println(getGCD(3, 1));;
	}
	
	//a >= b
	public static long getGCD(long a, long b){
		long ta = a, tb = b;
		while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		}
		
		return ta;
	}
	
	//a >= b
	public static long getLCM(long a, long b){
		long p, q, r;
		p = a;
		q = b;
		r = b;
		long tmp;
		do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0);
		
		return tmp;
	}

} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	}
	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		}
//		System.out.println(getGCD(8, 6));;
//		System.out.println(getGCD(50000000, 30000000));;
//		System.out.println(getGCD(3, 1));;
	}
	
	//a >= b
	public static long getGCD(long a, long b){
		long ta = a, tb = b;
		while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		}
		
		return ta;
	}
	
	//a >= b
	public static long getLCM(long a, long b){
		long p, q, r;
		p = a;
		q = b;
		r = b;
		long tmp;
		do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0);
		
		return tmp;
	}

} Main
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();

	}
	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			long a = sc.nextLong();
			long b = sc.nextLong();
			System.out.println(getLCM(a, b) + " " + getGCD(a, b));
		}
//		System.out.println(getGCD(8, 6));;
//		System.out.println(getGCD(50000000, 30000000));;
//		System.out.println(getGCD(3, 1));;
	}
	
	//a >= b
	public static long getGCD(long a, long b){
		long ta = a, tb = b;
		while(true){
			if(ta == tb){
				break;
			}
			while(ta > tb){
				tb += b;
			}
			while(tb > ta){
				ta += a;
			}
			//System.out.println("ta = " + ta + ", tb = " + tb);
			
		}
		
		return ta;
	}
	
	//a >= b
	public static long getLCM(long a, long b){
		long p, q, r;
		p = a;
		q = b;
		r = b;
		long tmp;
		do{
			tmp = r;
			r = p % q;
			p = q;
			q = r;
			
		}while(r != 0);
		
		return tmp;
	}

}