
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
	
	private static ArrayList<Long> gcd = new ArrayList<Long>();
	private static ArrayList<Long> lcm = new ArrayList<Long>();
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		}
		
		//ツ催妥・ツ古カツ姪アツ青板δ環スツトツづ催渉ャツ古カツ倍ツ青板δ環スツトツづーツ出ツ療債つキツづゥ
		int sizeAnswerList = gcd.size();
		for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		}
	}
	
	private static long getGCD(long a, long b){
		long numBigger;
		long numSmaller;
		if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		}
		
		long gcd;
		while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		}
		
		return gcd;
	}
	
	private static long getLCM(long a, long b){
		long tmp = b / getGCD(a, b);
		return a * tmp;
	}
} import java.util.ArrayList; ArrayList java.util import java.util.NoSuchElementException; NoSuchElementException java.util import java.util.Scanner; Scanner java.util public class Main {
	
	private static ArrayList<Long> gcd = new ArrayList<Long>();
	private static ArrayList<Long> lcm = new ArrayList<Long>();
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		}
		
		//ツ催妥・ツ古カツ姪アツ青板δ環スツトツづ催渉ャツ古カツ倍ツ青板δ環スツトツづーツ出ツ療債つキツづゥ
		int sizeAnswerList = gcd.size();
		for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		}
	}
	
	private static long getGCD(long a, long b){
		long numBigger;
		long numSmaller;
		if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		}
		
		long gcd;
		while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		}
		
		return gcd;
	}
	
	private static long getLCM(long a, long b){
		long tmp = b / getGCD(a, b);
		return a * tmp;
	}
} Main private static ArrayList<Long> gcd = new ArrayList<Long>(); gcd new ArrayList<Long>() private static ArrayList<Long> lcm = new ArrayList<Long>(); lcm new ArrayList<Long>() public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		}
		
		//ツ催妥・ツ古カツ姪アツ青板δ環スツトツづ催渉ャツ古カツ倍ツ青板δ環スツトツづーツ出ツ療債つキツづゥ
		int sizeAnswerList = gcd.size();
		for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		}
		
		//ツ催妥・ツ古カツ姪アツ青板δ環スツトツづ催渉ャツ古カツ倍ツ青板δ環スツトツづーツ出ツ療債つキツづゥ
		int sizeAnswerList = gcd.size();
		for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		} catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		} NoSuchElementException e {
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		} {
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		} while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			} sc.hasNextLong() sc.hasNextLong sc {
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			} long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc gcd.add(getGCD(a, b)) gcd.add gcd getGCD(a, b) getGCD a b lcm.add(getLCM(a, b)) lcm.add lcm getLCM(a, b) getLCM a b int sizeAnswerList = gcd.size(); sizeAnswerList gcd.size() gcd.size gcd for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		} int i = 0; int i = 0; i 0 i < sizeAnswerList i sizeAnswerList i++ i++ i {
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		} {
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		} System.out.println(gcd.get(i) + " " + lcm.get(i)) System.out.println System.out System System.out gcd.get(i) + " " + lcm.get(i) gcd.get(i) + " " + lcm.get(i) gcd.get(i) gcd.get gcd i " " lcm.get(i) lcm.get lcm i String[] args args private static long getGCD(long a, long b){
		long numBigger;
		long numSmaller;
		if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		}
		
		long gcd;
		while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		}
		
		return gcd;
	} getGCD {
		long numBigger;
		long numSmaller;
		if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		}
		
		long gcd;
		while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		}
		
		return gcd;
	} long numBigger; numBigger long numSmaller; numSmaller if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		} a > b a b {
			numBigger = a;
			numSmaller = b;
		} numBigger = a numBigger a numSmaller = b numSmaller b {
			numBigger = b;
			numSmaller = a;
		} numBigger = b numBigger b numSmaller = a numSmaller a long gcd; gcd while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		} true {
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		} if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			} numBigger == numSmaller numBigger numSmaller {
				gcd = numBigger;
				break;
			} gcd = numBigger gcd numBigger break; long tmp = numBigger; tmp numBigger numBigger = numSmaller numBigger numSmaller numSmaller = tmp - numSmaller numSmaller tmp - numSmaller tmp numSmaller if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			} numBigger < numSmaller numBigger numSmaller {
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			} tmp = numBigger tmp numBigger numBigger = numSmaller numBigger numSmaller numSmaller = tmp numSmaller tmp return gcd; gcd long a a long b b private static long getLCM(long a, long b){
		long tmp = b / getGCD(a, b);
		return a * tmp;
	} getLCM {
		long tmp = b / getGCD(a, b);
		return a * tmp;
	} long tmp = b / getGCD(a, b); tmp b / getGCD(a, b) b getGCD(a, b) getGCD a b return a * tmp; a * tmp a tmp long a a long b b public class Main {
	
	private static ArrayList<Long> gcd = new ArrayList<Long>();
	private static ArrayList<Long> lcm = new ArrayList<Long>();
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		}
		
		//ツ催妥・ツ古カツ姪アツ青板δ環スツトツづ催渉ャツ古カツ倍ツ青板δ環スツトツづーツ出ツ療債つキツづゥ
		int sizeAnswerList = gcd.size();
		for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		}
	}
	
	private static long getGCD(long a, long b){
		long numBigger;
		long numSmaller;
		if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		}
		
		long gcd;
		while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		}
		
		return gcd;
	}
	
	private static long getLCM(long a, long b){
		long tmp = b / getGCD(a, b);
		return a * tmp;
	}
} public class Main {
	
	private static ArrayList<Long> gcd = new ArrayList<Long>();
	private static ArrayList<Long> lcm = new ArrayList<Long>();
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		}
		
		//ツ催妥・ツ古カツ姪アツ青板δ環スツトツづ催渉ャツ古カツ倍ツ青板δ環スツトツづーツ出ツ療債つキツづゥ
		int sizeAnswerList = gcd.size();
		for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		}
	}
	
	private static long getGCD(long a, long b){
		long numBigger;
		long numSmaller;
		if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		}
		
		long gcd;
		while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		}
		
		return gcd;
	}
	
	private static long getLCM(long a, long b){
		long tmp = b / getGCD(a, b);
		return a * tmp;
	}
} Main

import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
	
	private static ArrayList<Long> gcd = new ArrayList<Long>();
	private static ArrayList<Long> lcm = new ArrayList<Long>();
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		try{
			while(sc.hasNextLong()){
				long a = sc.nextLong();
				long b = sc.nextLong();
				gcd.add(getGCD(a, b));
				lcm.add(getLCM(a, b));
			}
		}catch(NoSuchElementException e){
			//ツ禿シツ療債づ個終ツづュツづィツつェツ禿シツ療債つウツづェツつスツづァツ篠淞づ個コツーツドツづ鳴渉按猟敖づーツ進ツづ淞づゥ
		}
		
		//ツ催妥・ツ古カツ姪アツ青板δ環スツトツづ催渉ャツ古カツ倍ツ青板δ環スツトツづーツ出ツ療債つキツづゥ
		int sizeAnswerList = gcd.size();
		for(int i = 0; i < sizeAnswerList; i++){
			System.out.println(gcd.get(i) + " " + lcm.get(i));
		}
	}
	
	private static long getGCD(long a, long b){
		long numBigger;
		long numSmaller;
		if(a > b){
			numBigger = a;
			numSmaller = b;
		}
		else{
			numBigger = b;
			numSmaller = a;
		}
		
		long gcd;
		while(true){
			if(numBigger == numSmaller){
				gcd = numBigger;
				break;
			}
			long tmp = numBigger;
			numBigger = numSmaller;
			numSmaller = tmp - numSmaller;
			if(numBigger < numSmaller){
				tmp = numBigger;
				numBigger = numSmaller;
				numSmaller = tmp;
			}
		}
		
		return gcd;
	}
	
	private static long getLCM(long a, long b){
		long tmp = b / getGCD(a, b);
		return a * tmp;
	}
}