import java.math.BigInteger;
import java.util.Scanner;


public class Main{
	public static void main(String args[]){
		new Main().run();
	}

	void run(){
		Scanner sc = new Scanner(System.in);
		String a;
		while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		}
	}

	BigInteger solve(BigInteger bi1, BigInteger bi2){
		if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		}
		return bi2;
	}
} import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){
		new Main().run();
	}

	void run(){
		Scanner sc = new Scanner(System.in);
		String a;
		while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		}
	}

	BigInteger solve(BigInteger bi1, BigInteger bi2){
		if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		}
		return bi2;
	}
} Main public static void main(String args[]){
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String args[] args void run(){
		Scanner sc = new Scanner(System.in);
		String a;
		while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		}
	} run {
		Scanner sc = new Scanner(System.in);
		String a;
		while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a; a while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		} true {
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		} if(!sc.hasNext()){
				break;
			} !sc.hasNext() sc.hasNext() sc.hasNext sc {
				break;
			} break; a = sc.next() a sc.next() sc.next sc BigInteger bi1 = new BigInteger(a); bi1 new BigInteger(a) BigInteger bi12 = bi1; bi12 bi1 a = sc.next() a sc.next() sc.next sc BigInteger bi2 = new BigInteger(a); bi2 new BigInteger(a) BigInteger bi22 = bi2; bi22 bi2 switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			} bi1.compareTo(bi2) bi1.compareTo bi1 bi2 case 1: 1 case 1: bi1 = solve(bi1,bi2) bi1 solve(bi1,bi2) solve bi1 bi2 break; case 0: 0 case 0: break; case -1: -1 1 case -1: bi1 = solve(bi2,bi1) bi1 solve(bi2,bi1) solve bi2 bi1 break; System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1)) System.out.println System.out System System.out bi1+" "+bi12.multiply(bi22).divide(bi1) bi1+" "+bi12.multiply(bi22).divide(bi1) bi1 " " bi12.multiply(bi22).divide(bi1) bi12.multiply(bi22).divide bi12.multiply(bi22) bi12.multiply bi12 bi22 bi1 BigInteger solve(BigInteger bi1, BigInteger bi2){
		if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		}
		return bi2;
	} solve {
		if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		}
		return bi2;
	} if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		} !bi1.remainder(bi2).equals(new BigInteger("0")) bi1.remainder(bi2).equals(new BigInteger("0")) bi1.remainder(bi2).equals bi1.remainder(bi2) bi1.remainder bi1 bi2 new BigInteger("0") {
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		} bi1 = bi1.remainder(bi2) bi1 bi1.remainder(bi2) bi1.remainder bi1 bi2 return solve(bi2,bi1); solve(bi2,bi1) solve bi2 bi1 return bi2; bi2 BigInteger bi1 bi1 BigInteger bi2 bi2 public class Main{
	public static void main(String args[]){
		new Main().run();
	}

	void run(){
		Scanner sc = new Scanner(System.in);
		String a;
		while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		}
	}

	BigInteger solve(BigInteger bi1, BigInteger bi2){
		if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		}
		return bi2;
	}
} public class Main{
	public static void main(String args[]){
		new Main().run();
	}

	void run(){
		Scanner sc = new Scanner(System.in);
		String a;
		while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		}
	}

	BigInteger solve(BigInteger bi1, BigInteger bi2){
		if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		}
		return bi2;
	}
} Main
import java.math.BigInteger;
import java.util.Scanner;


public class Main{
	public static void main(String args[]){
		new Main().run();
	}

	void run(){
		Scanner sc = new Scanner(System.in);
		String a;
		while(true){
			if(!sc.hasNext()){
				break;
			}
			a = sc.next();
			BigInteger bi1 = new BigInteger(a);
			BigInteger bi12 = bi1;
			a = sc.next();
			BigInteger bi2 = new BigInteger(a);
			BigInteger bi22 = bi2;
			switch(bi1.compareTo(bi2)){
			case 1:
				//テ・ツシツ陛ヲツ閉ーテ」ツつ暗」ツつ甘・ツ、ツァテ」ツ?催」ツ??
				bi1 = solve(bi1,bi2);
				break;
			case 0:
				//テ・ツシツ陛ヲツ閉ーテ」ツ?ィテ・ツ青古」ツ??
				break;
			case -1:
				bi1 = solve(bi2,bi1);
				break;
			}
			System.out.println(bi1+" "+bi12.multiply(bi22).divide(bi1));
		}
	}

	BigInteger solve(BigInteger bi1, BigInteger bi2){
		if(!bi1.remainder(bi2).equals(new BigInteger("0"))){
			bi1 = bi1.remainder(bi2);
			return solve(bi2,bi1);
		}
		return bi2;
	}
}