Go: package main
import (
	"os"
	"fmt"
	"strconv"
	"bufio"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main(){
	sc.Split(bufio.ScanLines)
	defer out.Flush()

	for sc.Scan(){
		a, b := nextInts()
		x, y := gcd(a, b), lcm(a, b)
		fmt.Fprintf(out, "%d %d\n", x, y)
	}

}

func nextInts()(a, b int){
	s := strings.Split(sc.Text(), " ")
	ra, _ := strconv.Atoi(s[0])
	rb, _ := strconv.Atoi(s[1])
	a = ra
	b = rb
	return
}

func gcd(x, y int) int{
	if x<y{
		gcd(y, x)
	}
	for 0<y{
		r := x%y
		x, y = y, r
	}
	return x
}

func lcm(x, y int)int{
	return (x*y)/gcd(x, y)
}

C++: #include<iostream>

using namespace std;

long yakusuu(long a,long b){
	int t;
	if(a>=b) t=a;
	if(a<b) t=b;
	
	for(long i=t ;i>=1 ;i--){

			if(a%i==0 && b%i==0){
				return i;
				break;
			}
	}
}

long baisuu(long a,long b){

	for(long i=1;i<=a*b ;i++){
		if(i%a==0 && i%b==0){
			return i;
			break;
		}
	}
}


int main(){


	long a,b;
	long R,L;

	cin >> a >> b;

	R=yakusuu(a,b);
	L=baisuu(a,b);

	cout << R << " " << L <<endl;

	return 0;

}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int gcd(int a, int b){
    int p,q,r;if(a<b){
        p=b;b=a;a=p;
        }
        while(r!=0){
        q=b/a;
        r=b%a;
        b=a;
        a=r;
        }
        return b;
        }
int main(void){
    int a, b;
    while(cin >> a >> b) {
        int lcm = a/gcd(a,b)*b;
        cout << gcd(a,b) << " " << lcm << endl;
        }
        return 0;
    
}

C++: #include <iostream>
using namespace std;

long long gcd(long long a,long long b)
    {long long t;if(a>b)t=a,a=b,b=t;while(a)t=a,a=b%a,b=t;return b;}
long long lcm(long long a,long long b){return a*b/gcd(a,b);}

int main()
{
	long long a,b;
	while(cin>>a>>b)
	{
		cout << gcd(a,b)<< " " <<lcm(a,b) << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;

int gcd(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v; u = v; v = r; /* swap */
  }
  return u;
}

int main(){
	int a,b,x;
	while(scanf("%d",&a)!=EOF){
		cin>>b;
	cout<<gcd(a,b)<<" ";
	x=a*b;
	if(a<b){
		int tmp = a;
		a = b;
		b = tmp;
	}
	cout<<x/gcd(a,b)<<endl;
	}
    return 0;
}

C++: #include <cassert>
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
  return a*b / gcd(a, b);
}

int main() {
    ll a, b;
	while (cin >> a >> b) {
	    cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int gcd(int x,int y){
	if(x==0)return y;
	return gcd(y%x,x);
}
int main(){
	while(true){
		int a,b;
		cin>>a>>b;
		if(cin.eof())return 0;
		int g=gcd(a,b);
		cout<<g<<' '<<a/g*b<<endl;
	}
}

C++: #include <iostream> 
#include<string.h>
#include<stdio.h>
using namespace std;
long long cc( long  long  q, long long  p)
{

	if(q%p==0)
	{
		return p;
	}
	else
	return cc(p,q%p);
}
main()
{
	long long x,y,a[1000],b[1000];
	int i=0;
	while(scanf("%lld%lld",&x,&y)!=EOF)
	{
	  
		 a[i]=cc(x,y);
		 b[i]=x/a[i]*y;
	     i++;	
	     
	}
	for(int j=0;j<i;j++)
	{
		printf("%lld %lld\n",a[i],b[i]);
	}
}

C++: #include <stdio.h>
using namespace std;

int gcd(int num1,int num2) {
	if (num2 == 0) {
		return num1;
	}return gcd(num2, num1 % num2);
}

int lcm(int num1,int num2) {
	return num1 / gcd(num1, num2) * num2;
}

int main() {
	long a, b;
	while (scanf_s("%d %d",&a,&b)!=EOF) {
		printf("%d %d\n", gcd(a, b),lcm(a,b));
	}
}

C++: # include <iostream>

unsigned long a, b;

unsigned long gcd(unsigned long x, unsigned long y) {
	return (y == 0) ? x : gcd(y, x%y);
}

unsigned long  lcm(unsigned long x, unsigned long y, unsigned long g) {
	return x / g*y;
}

int main() {
	while (1) {
		if (std::cin.eof())
			break;
		std::cin >> a >> b;
		unsigned long res1, ans;
		if (a < b)
			res1 = gcd(b, a);
		else
			res1 = gcd(a, b);
		ans = lcm(a, b, res1);
		std::cout << res1 <<' '<< ans << std::endl;
	}
	return 0;
}

C++: #include "cstdio"
#include "cstring"
#include"algorithm"
using namespace std;
long long gcd(long long a,long long b)
{
	if(a<b)return gcd(b,a);
	if(b==0)return a;
	return gcd(b,a%b);
}
long long lcm(long long a,long long b)
{
	return a*b/gcd(a,b);
}
int main()
{
    //freopen("input.txt","r",stdin);
   	long long a,b;
   	while(scanf("%lld%lld",&a,&b)!=EOF)
   	{	
   		printf("%lld %lld\n",gcd(a,b),lcm(a,b));
   	}

    return 0;
};

C++: #include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
long long a,b,aa,bb;
long long c,d,tmp;
while(cin>>a>>b){
        if(a < b)swap(a,b);
        aa=a;
        bb=b;
        while(b!=0){
                tmp = a%b;
                a = b;
                b = tmp;
        }
        c=aa*bb/a;
        cout<<a<<' '<<c<<endl;
}
        return 0;
}

C++: #include <iostream>			//std::cout, std::cin
#include <string>			//std::string,std::to_string(C++11)
#include <vector>			//std::vector
#include <valarray>			//std::valarray
#include <algorithm>		//std::sort
#include <ctime>			//localtime_s
#include <cstdlib>			//abs
#include <cmath>			//abs,std::pow,sqrt,sin,cos,round,floor,ceil
#include <fstream>			//std::ifstream,std::ofstream
#include <iomanip>			//std::setprecision,std::setw,std::setfill
#include <random>			//std::random(C++11)
#include <numeric>			//std::accumulate
#include <functional>		//std::greater
#include <chrono>			//std::chrono(C++11)
#include <bitset>			//std::bitset
#include <queue>			//std::queue

const static double	de_PI	= 3.14159265358979323846;
const static int	de_MOD	= 1000000007;
const static int	de_MAX	= 999999999;

unsigned long long Greatest_Common_Divisor(unsigned long long a, unsigned long long b) {

	while (a != 0 && b != 0) {
		if (a > b) {
			a = a - b;
		}
		else {
			b = b - a;
		}
	}
	return(a + b);
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());
	//std::ofstream ofs("456.csv");
	//std::chrono::system_clock::time_point t_st = std::chrono::system_clock::now();

	unsigned long long a = 0, b = 0;
	std::vector<unsigned long long> GCD,LCM;

	while (std::cin >> a) {
		std::cin >> b;
		GCD.push_back(Greatest_Common_Divisor(a, b));
		LCM.push_back(a*b / GCD.back());
	}

	for (unsigned int i = 0; i < GCD.size(); i++) {
		std::cout << GCD[i] << " " << LCM[i] << std::endl;
	}

	//std::chrono::system_clock::time_point t_ed = std::chrono::system_clock::now();
	//std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(t_ed - t_st).count() << "ms" << std::endl;

}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,d,e;
	
	for(int i=0;i<2;i++){
	std::cin>>a>>b;
	d=a;
	e=b;
	if(b>a){
		d = a;
		a = b;
		b = d;
	}
	while(b!=0){
		c = a % b;
		a = b;
		b = c;
	}
std::cout<<a<<" "<<((e/a)*(d/a)*a)<<endl;8
	}
}

C++: #include <iostream>

int main() {
  long a,b;

  while(std::cin >> a >> b) {
    long gcd = 1;
    long lcm = 1;

    long min;
    long cnt = 2;

    do {
      while((a % cnt == 0) && a % cnt == b % cnt) {
        a /= cnt;
        b /= cnt;
        gcd *= cnt;
      }
      min = (a < b) ? a : b;
      ++cnt;
    }while(min > cnt);

    lcm = gcd * a * b;
    std::cout << gcd << " " << lcm <<std::endl;
  }

}

C++: #include<iostream>
#include<cstdlib>
#include<algorithm>

using namespace std;

int gcd(int a,int b)
{
	if (b == 0)return a;
	return gcd(b, a%b);
}

int main(){
	long long a, b;
	while (scanf("%lld%lld", &a, &b) != EOF)
	{
		int d = gcd(a, b);
		int  lcm = a /d *b;
		printf("%d %d\n", d, lcm);
	}
}

C++: #include <stdio.h>

int
main(void)
{
	char line[80];
	unsigned long a;
	unsigned long b;

	while (gets(line)) {
		if (sscanf(line, "%lu %lu", &a, &b) == 2) {
			unsigned long x = a;
			unsigned long y = b;
			unsigned long q;
			unsigned long r;
			while (true) {
				q = x / y;
				r = x - q * y;
				if (r == 0) {
					break;
				}
				x = y;
				y = r;
			}
			printf("%lu %lu\n", y, (a/y)*b);
		}
	}

	return 0;
}