import java.io.*;

import java.util.*;



class Main{

	private static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){

		ArrayList<Integer> b = new ArrayList<Integer>();

				

		for(int i = 0;i<a.size()/2;i++){

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			}

		return b;

	}

	private static void print_calc(ArrayList<Integer> a){

		String str1,str2;

		int x,y;

		

		for(int i = 0;i<a.size()/2;i++){	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		}

	}

		public static void main(String args[]) throws IOException{

			ArrayList<Integer> val = new ArrayList<Integer>();

			Scanner scan = new Scanner(System.in);

			int n;

			

			while(scan.hasNext()){

					String str1 = scan.next();
					n = Integer.valueOf(str1).intValue(); 

					val.add(n);

			}

						

			

			ArrayList<Integer> res = new ArrayList<Integer>();

			res = calc_gcd_lcm(val);

			print_calc(res);

	}

} import java.io.*; io.* java import java.util.*; util.* java class Main{

	private static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){

		ArrayList<Integer> b = new ArrayList<Integer>();

				

		for(int i = 0;i<a.size()/2;i++){

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			}

		return b;

	}

	private static void print_calc(ArrayList<Integer> a){

		String str1,str2;

		int x,y;

		

		for(int i = 0;i<a.size()/2;i++){	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		}

	}

		public static void main(String args[]) throws IOException{

			ArrayList<Integer> val = new ArrayList<Integer>();

			Scanner scan = new Scanner(System.in);

			int n;

			

			while(scan.hasNext()){

					String str1 = scan.next();
					n = Integer.valueOf(str1).intValue(); 

					val.add(n);

			}

						

			

			ArrayList<Integer> res = new ArrayList<Integer>();

			res = calc_gcd_lcm(val);

			print_calc(res);

	}

} Main private static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){

		ArrayList<Integer> b = new ArrayList<Integer>();

				

		for(int i = 0;i<a.size()/2;i++){

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			}

		return b;

	} calc_gcd_lcm {

		ArrayList<Integer> b = new ArrayList<Integer>();

				

		for(int i = 0;i<a.size()/2;i++){

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			}

		return b;

	} ArrayList<Integer> b = new ArrayList<Integer>(); b new ArrayList<Integer>() for(int i = 0;i<a.size()/2;i++){

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			} int i = 0; int i = 0; i 0 i<a.size()/2 i a.size()/2 a.size() a.size a 2 i++ i++ i {

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			} {

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			} int x x y y x1 x1 y1 y1 j j k; k x1 = 0 x1 0 y1 = 0 y1 0 if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			} a.get(i*2) > a.get(i*2+1) a.get(i*2) a.get a i*2 i 2 a.get(i*2+1) a.get a i*2+1 i*2 i 2 1 {
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			} x = a.get(i*2) x a.get(i*2) a.get a i*2 i 2 y = a.get(i*2+1) y a.get(i*2+1) a.get a i*2+1 i*2 i 2 1 x1 = x x1 x y1 = y y1 y {
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			} x = a.get(i*2+1) x a.get(i*2+1) a.get a i*2+1 i*2 i 2 1 y = a.get(i*2) y a.get(i*2) a.get a i*2 i 2 x1 = x x1 x y1 = y y1 y j = x1%y1 j x1%y1 x1 y1 while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			} j != 0 j 0 {
				x1 = y1;
				y1 = j;
				j = x1%y1;
			} x1 = y1 x1 y1 y1 = j y1 j j = x1%y1 j x1%y1 x1 y1 b.add(y1) b.add b y1 k = x/y1*y k x/y1*y x/y1 x y1 y b.add(k) b.add b k return b; b ArrayList<Integer> a a private static void print_calc(ArrayList<Integer> a){

		String str1,str2;

		int x,y;

		

		for(int i = 0;i<a.size()/2;i++){	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		}

	} print_calc {

		String str1,str2;

		int x,y;

		

		for(int i = 0;i<a.size()/2;i++){	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		}

	} String str1 str1 str2; str2 int x x y; y for(int i = 0;i<a.size()/2;i++){	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		} int i = 0; int i = 0; i 0 i<a.size()/2 i a.size()/2 a.size() a.size a 2 i++ i++ i {	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		} {	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		} x = a.get(i*2) x a.get(i*2) a.get a i*2 i 2 y = a.get(i*2+1) y a.get(i*2+1) a.get a i*2+1 i*2 i 2 1 System.out.println( x + " " + y ) System.out.println System.out System System.out x + " " + y x + " " + y x " " y ArrayList<Integer> a a public static void main(String args[]) throws IOException{

			ArrayList<Integer> val = new ArrayList<Integer>();

			Scanner scan = new Scanner(System.in);

			int n;

			

			while(scan.hasNext()){

					String str1 = scan.next();
					n = Integer.valueOf(str1).intValue(); 

					val.add(n);

			}

						

			

			ArrayList<Integer> res = new ArrayList<Integer>();

			res = calc_gcd_lcm(val);

			print_calc(res);

	} main {

			ArrayList<Integer> val = new ArrayList<Integer>();

			Scanner scan = new Scanner(System.in);

			int n;

			

			while(scan.hasNext()){

					String str1 = scan.next();
					n = Integer.valueOf(str1).intValue(); 

					val.add(n);

			}

						

			

			ArrayList<Integer> res = new ArrayList<Integer>();

			res = calc_gcd_lcm(val);

			print_calc(res);

	} ArrayList<Integer> val = new ArrayList<Integer>(); val new ArrayList<Integer>() Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n; n while(scan.hasNext()){

					String str1 = scan.next();
					n = Integer.valueOf(str1).intValue(); 

					val.add(n);

			} scan.hasNext() scan.hasNext scan {

					String str1 = scan.next();
					n = Integer.valueOf(str1).intValue(); 

					val.add(n);

			} String str1 = scan.next(); str1 scan.next() scan.next scan n = Integer.valueOf(str1).intValue() n Integer.valueOf(str1).intValue() Integer.valueOf(str1).intValue Integer.valueOf(str1) Integer.valueOf Integer str1 val.add(n) val.add val n ArrayList<Integer> res = new ArrayList<Integer>(); res new ArrayList<Integer>() res = calc_gcd_lcm(val) res calc_gcd_lcm(val) calc_gcd_lcm val print_calc(res) print_calc res String args[] args
import java.io.*;

import java.util.*;



class Main{

	private static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){

		ArrayList<Integer> b = new ArrayList<Integer>();

				

		for(int i = 0;i<a.size()/2;i++){

			

			int x,y,x1,y1,j,k;
			x1 = 0;
			y1 = 0;

			if(a.get(i*2) > a.get(i*2+1)){
				x = a.get(i*2);
				y = a.get(i*2+1);
				x1 = x;
				y1 = y;
			}
			else{
				x = a.get(i*2+1);
				y = a.get(i*2);
				x1 = x;
				y1 = y;
			}

			j = x1%y1;
			
			while(j != 0){
				x1 = y1;
				y1 = j;
				j = x1%y1;
			}
			b.add(y1);
			k = x/y1*y;
			b.add(k);

			

			}

		return b;

	}

	private static void print_calc(ArrayList<Integer> a){

		String str1,str2;

		int x,y;

		

		for(int i = 0;i<a.size()/2;i++){	

			

			x = a.get(i*2);

			y = a.get(i*2+1);

			

			System.out.println( x + " " + y );

			

		}

	}

		public static void main(String args[]) throws IOException{

			ArrayList<Integer> val = new ArrayList<Integer>();

			Scanner scan = new Scanner(System.in);

			int n;

			

			while(scan.hasNext()){

					String str1 = scan.next();
					n = Integer.valueOf(str1).intValue(); 

					val.add(n);

			}

						

			

			ArrayList<Integer> res = new ArrayList<Integer>();

			res = calc_gcd_lcm(val);

			print_calc(res);

	}

}