Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"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() {
		x, y := nextInts()
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		fmt.Fprintf(out, "%d %d\n", y, lcm/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
}

C++: #include<iostream>
using namespace std;
int main(){
int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
 cout << lcm << ' ' << gcd << endl;
 retrun 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	
	int a, b, c = 0;
	while (cin >> a, cin >> b)
	{
		for (int i = 1; i <= a, i <= b; i++)
		{
			if (a % i == 0 && b % i == 0)
			{
				c = i;
			}
		}
		cout << c << " " << a*b / c << endl;
	}
	getchar();
	getchar();
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;

long long GCD(long long X, long long Y) {
	if (Y == 0) return X;
	return GCD(Y, X % Y);
}

int main() {
	long long A, B;
	while (cin >> A >> B) {
		cout << GCD(A, B) << " " << A * (B / GCD(A, B)) << endl;
	}
}

C++: #include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <string>

using namespace std;
int main()
{
 int x,y,n,a,b,gcf;
 while(cin>>x>>y)
 {
  a=x;
  b=y;
  while(x%y!=0)
  {
   n=x%y;
   x=y;
   gcf=n;
  }
  x=a;
  y=b;
 cout<<gcf<<" "<<(x*y)/gcf<<endl;
 }
return 0;
}

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

int gcd(long long int a,long long int b){
  return __gcd(a,b);
}
int lcm(long long int a,long long int b){
  return a*b/gcd(a,b);
}

int main(void){
  long long int a,b;
  while(cin>>a>>b){
    long long int ma = max(a,b);
    long long int mi = min(a,b);
    cout<<gcd(ma,mi)<<" "<<lcm(ma,mi)<<endl;
  }
}

C++: #include <iostream>

using namespace std;

int main()
{
	
	int a, b, c = 0;
	while (cin >> a, cin >> b)
	{
		for (int i = 1; i <= a, i <= b; i++)
		{
			if (a % i == 0 && b % i == 0)
			{
				c = i;
			}
		}
		cout << c << " " << a*b / c << endl;
	}
	getchar();
	getchar();
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	long long a, b, c,d,e,A,B,C;
	c = 9;
	d = 9;
	e = 9;
	C = 9;
	while (cin >> a >> b) {
		if (a < b) { swap(a, b); }
		A = a;
		B = b;
		while (1) {
			if (c == 0) { break; }
			c = a%b;
			a = b;
			b = c;
		}
		d = A / a;
		e = B / a;
		C = a*d*e;
		cout << a << ' ' << C << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int a, b;
int g, l;

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

int main(void)
{
	while(1){
		if(cin.eof()) break;
		cin >> a >> b;
		
		g = gcd(a, b);
		l = a / g * b;
		cout << g << " " << l << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
    long long a,b,c,d,e;
    while(cin>>a>>b){
    for(long long i=1;i<2000000000;i++){
        if(a%i==0 && b%i==0){
            c=i;
            break;
        }
    }
    e=a*b/c;
    cout<<c<<" "<<e<<endl;
    }
    return 0;
}

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

int main() {
	unsigned long long a,b,e,f,l;
	while(cin>>a>>b){
		e=a;
		f=b;
		while(1){
		if(e>f){
			e=e%f;
		}
	    if(f>e){
	    	f=f%e;
	    }
	    if(f==e){
	    	l=e;
	    	cout<<l<<" "<<(a*b)/l<<endl;
	    	break;
	    }
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int gcd(int a,int b){
    while(a>0&&b>0){
        if(a>b)
            a%=b;
        else
            b%=a;
    }
    if(a==0)
        return b;
    else if(b==0)
        return a;
}
int main(){
    int a,b;
    while(cin>>a>>b){
        int c=gcd(a,b);
        int lcm=(a*b)/c;
        cout<<c<<" "<<lcm<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <queue>
#include <stack>
#include <list>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <utility>
#include <climits>
using namespace std;

#define print(v) for (int i = 0; i < v.size(); ++i) cout << v[i] << " "; cout << endl;
template <class T>
void printMatrix(vector< vector< T > >& matrix) {
  for (int i = 0; i < matrix.size(); ++i) {
    for (int j = 0; j < matrix[i].size(); ++j) {
      cout << matrix[i][j] << " ";
    }
    cout << endl;
  }
  cout << endl;
}

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector< ii > vii;

const int UNVISITED = -1;
const int VISITED = 1;
const int INF = 1000000005;

vector<vi> AdjMatrix;
vector<int> dfs_num;

long long gcd(long long a, long long b) {
  return (!b) ? a : gcd(b, a % b);
}

long long lcm(long long n, long long m) {
  return (m * n) / gcd(m, n);
}

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

C++:  #include <stdio.h>
using namespace std;
 long long int n,m,ans,amari,ahokusa;

 int main(void)
 {
    while(1)
    {
         scanf("%lld%lld",&n,&m);
         ans  = n*m;
         if(n < m)
         {
             ahokusa = n;
             n = m;
             m = ahokusa;
         }
         amari = n % m;
         while(amari != 0)
         {
            n = m;
            m = amari;
            amari = n % m;
         }
         ans = ans / m;
         printf("%lld %lld\n",m,ans);
    }

     return 0;

 }

C++: #include<stdio.h>

int main(void)
{
	int num[2],koyak,escape;
	
	long int i;
	
	long int kobai;
	
	while(scanf("%d %d",&num[0],&num[1]) != EOF )
	{
		kobai = 0;
		koyak = 0;
		
		if(num[0] < num[1])
		{
			escape = num[0];
			num[0] = num[1];
			num[1] = escape;
		}
		
		for(i = num[1] ; i >= 1 ; i--)
		{
			if(0 == num[0] % i && 0 == num[1] % i)
			{
				koyak = i;
				break;
			}
		}
			
		i = 1;
		
		while(1) 
		{
			if(0 ==( num[0] * i ) %  num[1])
			{
				kobai = num[0] * i;
				break;
			}
			
			i++;
		}
		
		printf("%d %ld\n",koyak,kobai);
		
	}
	
	return 0;
}

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

using namespace std;

int getcom(int x, int y) {
	int no = 2;

	while (true) {
		if (no > x || no > y) {
			return 1;
		}

		if (x % no == 0 && y % no == 0) {
			x = x / no;
			y = y / no;
			return no * getcom(x, y);
		}
		no++;
	}
}

int main(void) {
	int a, b;

	vector<string> v;
	while (cin >> a >> b) {
		int com_div, com_mlt;

		com_div = getcom(a, b);
		com_mlt = (a / com_div) * (b / com_div) * com_div;
		stringstream ss;
		ss << com_div << " " << com_mlt;
		v.push_back(ss.str());
	}

	for (int i = 0; i < v.size(); i++) {
		cout << v[i] << endl;
	}

	return 0;
}

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

typedef long long ll;

ll gcd(ll a, ll b){
return a != 0 ? gcd(b % a, a) : b;
}
int main() {
ll a, b;
while(cin >> a >> b)
cout << gcd(a, b) << " " << a / gcd(a, b) * b << endl;
}

C++: #include <cstdio>
using namespace std;
typedef long long LL;

LL gcd(LL a, LL b){
    while(b){
        LL tmp = a % b;
        a = b;
        b = tmp;
    }
    return a;
}
int main(){
    LL a, b;
    while(~scanf("%d%d", &a, &b)){
        printf("%lld %lld\n", gcd(a, b), (a * b / gcd(a, b)));
    }
    return 0;
}