Go: package main

import (
	"fmt"
	"bufio"
	"os"
	"strings"
	"strconv"
)

func getInputAsInt(in string) (int, int) {
	inArr := strings.Split(in, " ")
	// Atoi(s string) (i int, err error) のerrは捨てる
	val1, _ := strconv.Atoi(inArr[0])
	val2, _ := strconv.Atoi(inArr[1])
	return val1, val2
}

func euclidean(val1, val2 int) (int) {
	surp := 1
	for  {
		surp = val1 % val2
		if surp != 0 {
			val1 = val2
			val2 = surp
		} else {
			break
		}
	}
	return val2
}

func calcLCM(val1, val2, gcd int) (int) {
	return val1/gcd*val2
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	
	for scanner.Scan() {
		val1, val2 := getInputAsInt(scanner.Text())
		gcd := euclidean(val1, val2)
		lcm := calcLCM(val1, val2, gcd)
		fmt.Println(gcd, lcm)
	}
}

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

long long int gcd(long long int m, long long int n) {
  return (n == 0 ? m : gcd(n, m % n));
}

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

int main(){
    long long int a, b;
    while(scanf("%lld %lld", &a, &b) != EOF){
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }

    return 0;
}

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

int gcd(int x,int y){
  if(x%y==0) return y;
  else{
    int z=x%y
    return gcd(y,z);
  }
}

int main()
{
  int a,b;
  int g;
  long int l;
  cin >> a >> b;
  
  if(a>b) g=gcd(a,b);
  else if(a<b) g=gcd(b,a);
  else g=a;

  l=a*b/g;
  cout << g << " " << l << " " << endl;

  return 0;
}

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

int main(){
int i = 0;int a = 0;int b = 0;int aa = 0;int bb = 0;
while(!cin.eof()){
cin >> a >> b;
if(a >= b){
aa = b;bb = a;
}
else{
aa = a;bb = b;
}
while(aa != 0){
int c = 0;
bb = bb % aa;
c = aa;
aa = bb;
bb = c;
}
cout << bb << " " << a * b / bb << endl;

}
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define N 2000000000
int main() {
	long long int a,b;
	while(cin>>a>>b){
		int* ahoge;
		int* bhoge;
		ahoge=(int*)malloc(sizeof(int)*N);
		bhoge=(int*)malloc(sizeof(int)*N);
		long long int i,j;
		for(i=2;a>1;i++){
			if(a%i==0){
				int count=0;
				do{
					a=a/i;
					count++;
				}while(a%i==0);
				ahoge[i]=count;
			}	
		}
		for(j=2;b>1;j++){
			if(b%j==0){
				int count=0;
				do{
					b=b/j;
					count++;
				}while(b%j==0);
				bhoge[j]=count;
			}	
		}
		long long int great,least,k;
		great=1;
		least=1;
		for(k=2;k<min(i,j);k++){
			great=great*pow(k,min(ahoge[k],bhoge[k]));
		}
		for(k=2;k<max(i,j);k++){
			least=least*pow(k,max(ahoge[k],bhoge[k]));
		}
		cout<<great<<" "<<least<<endl;
	}
	return 0;
}

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

unsigned gcd(unsigned a, unsigned b){
    return (b==0)?a:gcd(b,a%b);
}

int main(){
    unsigned a,b;
    while(cin>>a>>b){
        unsigned g = gcd(a,b);
        cout << g << " " << a/g*b << endl;
    }
    return 0;
}

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

int get_gcd(int a, int b) {
  int r;
  while (r = a % b) {
    a = b;
    b = r;
  }
  return b;
}

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

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

int main() {
	unsigned int a, b, gcd, lcm;
	while (cin >> a >> b) {
		for (gcd = a;a%gcd != 0 || b%gcd != 0;gcd--);
		lcm = (a / gcd)*(b / gcd)*gcd;
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>


long long int gcd(long long int n1, long long n2){

if(n2!=0){
    return gcd(n2, n1%n2);

    }
else
    return n1;
}
int main(){
    long long int a,b,lcm;
    while(scanf("%lld %lld",&a,&b)!=EOF){
        lcm=(a*b)/gcd(a,b);
        printf("%lld %lld",gcd(a,b),lcm);
    }
    return 0;

}

C++: #include<iostream>
int main(){for(int a,b,c,d,e,s;s=!(std::cin>>a>>b).eof();s&&printf("%d %d\n",c,d/c*e))for(d=a,c=e=b;a%=b;b=c)c=a,a=b;}

C++: #include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>

#include<iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include<string>
#include<queue>
#include<map>
#include<set>
#include<utility>
#include<queue>

using namespace std;

int gcd(int x,int y){
  //cout << x << ',' << y << endl;
  if(x == 0)return y;
  return gcd(y%x,x);
}

int main(){
  int x,y;
  while(cin >> x >> y){
    int tmp = gcd(x,y);
    cout << tmp  << ' '<< (x)*(y/tmp) << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
long koyaku(long a,long b);

int main(){
	long c,d,e;
	unsigned long f;
	while(cin>>c>>d){
		e=koyaku(c,d);
		f=c/e*d;
		cout<<e<<" "<<f<<endl;
	}
	return 0;
}

long koyaku(long a,long b){
	long n=max(a,b);
	long ans=1;
	for(long i=1;i<=n/2;i++){
		if(a%i==0&&b%i==0)ans=i;
	}
	if(a%n==0&&b%n==0)ans=n;
	return ans;
}

C++: 
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <limits.h>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <assert.h>
#include <cstring>
#include <bitset>
#include <complex>
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define db(x) {cout << #x << " = " << (x) << endl;}
#define dba(a, x, y) {cout<<#a<<" :";FOR(i123,x,y)cout<<setw(4)<<(a)[i123];cout<<endl;}
#define clr(x) memset(x,0,sizeof(x));
#define mp make_pair
#define pb push_back
#define sz(x) int((x).size())
#define endl '\n'
typedef long long ll;
typedef long double ld;
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
const ld pi = acos(-1);
// const int MOD = ;

ll gcd(ll a, ll b)
{
  while (b != 0)
  {
    ll tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
int main()
{
  ios_base::sync_with_stdio(0); cout.precision(15); cout << fixed; cout.tie(0); cin.tie(0);
  ll a, b;
  while (cin >> a >> b)
  {
    ll g = gcd(a, b);
    cout << g << " " << a * (b / g) << endl;
  }
}

C++: #include<stdio.h>
#include<iostream>
#include<string>
#include<cstdlib>

using namespace std;

int main()
{
	int  a, b,a1,b1,c,g;
	long l;
	cin >> a>>b;
	a1 = a;
	b1 = b;
	
		while (1)
		{
			c = abs(a - b);
			if (c == 0)
			{
				break;
			}

			if (a > b)
			{
				a = c;
				g = c;
			}
			else if (a<b)
			{
				b = c;
				g = c;
			}
		}
		l = (a1/g)*b1;
		cout << g << " " << l;
}

C++: #include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>

#include<iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include<string>
#include<queue>
#include<map>
#include<set>
#include<utility>
#include<queue>

using namespace std;

int gcd(int x,int y){
  cout << x << ','<<y << endl;
  if(x == 0)return y;
  return gcd(y%x,x);
}

int main(){
  int x,y;
  while(cin >> x >> y){
    int tmp;
    cout << (tmp = gcd(x,y)) << ' '<< (x)*(y/tmp) << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
typedef long long int ll;
ll gcm(ll a, ll b) {
  if (b > a) swap(a, b);
  ll r = a % b;
  if (r == 0) return b;
  else return gcm(b, r);
}
int main() {
  ll a, b;
  while (cin >> a >> b) {
    ll g = gcm(a, b);
    ll l = a * b / g;
    cout << g << " " << l << endl;
  }
  return 0;
}

C++: #include <cstdio>

using namespace std;

#define max( a, b ) ( ( a > b ) ? a : b )

int main()
{
	char buf[1024];
	int a, b;

	while ( fgets( buf, sizeof( buf ) - 1, stdin ) != NULL && buf[0] != '\n' )
	{
		sscanf( buf, "%d %d", &a, &b );
		
		for ( int i = max( a, b ) / 2; 1 < i; i-- )
		{
			if ( !( a % i ) && !( b % i ) )
			{
				printf("%d ", i );
				break;
			}
		}

		for ( int i = 1; i * max( a, b ) <= 2000000000; i++ )
		{
			if ( !( a * i % b ) )
			{
				printf("%d\n", a * i );
				break;
			}
		}
	}

	return 0;
}