import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//int tc = scan.nextInt();
		int rd = 1;
		while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		}
	}
	public static int LCD(int a, int b) {
		int z = Integer.min(a, b);
		
		for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		}
		return 1;
	}
	
	public static int GCD(int a, int b) {
		int c = a;
		int d = b;
		while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		}
		return a;
	}
} import java.util.ArrayList; ArrayList java.util import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//int tc = scan.nextInt();
		int rd = 1;
		while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		}
	}
	public static int LCD(int a, int b) {
		int z = Integer.min(a, b);
		
		for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		}
		return 1;
	}
	
	public static int GCD(int a, int b) {
		int c = a;
		int d = b;
		while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		}
		return a;
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//int tc = scan.nextInt();
		int rd = 1;
		while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		//int tc = scan.nextInt();
		int rd = 1;
		while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int rd = 1; rd 1 while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		} scan.hasNextInt() scan.hasNextInt scan {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		} int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int lcd = 0; lcd 0 int gcd = 0; gcd 0 lcd = LCD(a, b) lcd LCD(a, b) LCD a b gcd = GCD(a, b) gcd GCD(a, b) GCD a b System.out.println(lcd + " " + gcd) System.out.println System.out System System.out lcd + " " + gcd lcd + " " + gcd lcd " " gcd String[] args args public static int LCD(int a, int b) {
		int z = Integer.min(a, b);
		
		for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		}
		return 1;
	} LCD {
		int z = Integer.min(a, b);
		
		for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		}
		return 1;
	} int z = Integer.min(a, b); z Integer.min(a, b) Integer.min Integer a b for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		} int i = z; int i = z; i z i >= 1 i 1 i-- i-- i {
			if(a%i == 0 && b%i == 0)
				return i;
		} {
			if(a%i == 0 && b%i == 0)
				return i;
		} if(a%i == 0 && b%i == 0)
				return i; a%i == 0 && b%i == 0 a%i == 0 a%i a i 0 b%i == 0 b%i b i 0 return i; i return 1; 1 int a a int b b public static int GCD(int a, int b) {
		int c = a;
		int d = b;
		while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		}
		return a;
	} GCD {
		int c = a;
		int d = b;
		while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		}
		return a;
	} int c = a; c a int d = b; d b while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		} a != b a b {
			if(a < b)
				a+=c;
			else
				b+=d;
		} if(a < b)
				a+=c;
			else
				b+=d; a < b a b a+=c a c b+=d b d return a; a int a a int b b public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//int tc = scan.nextInt();
		int rd = 1;
		while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		}
	}
	public static int LCD(int a, int b) {
		int z = Integer.min(a, b);
		
		for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		}
		return 1;
	}
	
	public static int GCD(int a, int b) {
		int c = a;
		int d = b;
		while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		}
		return a;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//int tc = scan.nextInt();
		int rd = 1;
		while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		}
	}
	public static int LCD(int a, int b) {
		int z = Integer.min(a, b);
		
		for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		}
		return 1;
	}
	
	public static int GCD(int a, int b) {
		int c = a;
		int d = b;
		while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		}
		return a;
	}
} Main
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//int tc = scan.nextInt();
		int rd = 1;
		while(scan.hasNextInt()) {
			int a = scan.nextInt();
			int b = scan.nextInt();
			int lcd = 0;
			int gcd = 0;
			lcd = LCD(a, b);
			gcd = GCD(a, b);
			System.out.println(lcd + " " + gcd);
		}
	}
	public static int LCD(int a, int b) {
		int z = Integer.min(a, b);
		
		for(int i = z; i >= 1; i--) {
			if(a%i == 0 && b%i == 0)
				return i;
		}
		return 1;
	}
	
	public static int GCD(int a, int b) {
		int c = a;
		int d = b;
		while(a != b) {
			if(a < b)
				a+=c;
			else
				b+=d;
		}
		return a;
	}
}