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>
#include <math.h>
using namespace std;
#define ep 0.00001

int main()
{
	int a, b, temp;
	int a1, b1;
	int gcd, lcm;
	
	while (cin >> a >> b) {
		if (a > b) {
			temp = a;
			a = b;
			b = temp;
		}
		for (int i = b; i >= 1; i--) {
			if ((a % i == 0) && (b % i == 0)) {
				gcd = i;
				break;
			}
		}
		a1 = a;
		b1 = b;
		while (a1 != b1) {
			if (a1 < b1)
				a1 += a;
			else if (a1 > b1)
				b1 += b;
		}
		lcm = a1;
		cout << gcd << " " << lcm << "\n";
	}
	return 0;
}

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

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

int main() {
  int x,y;
  while(cin >> x >> y) {
    int a = gcm(x,y);
    cout << a << " " << x/a*y << endl;
  }
}

C++: #include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
using namespace std;

long long gcd(long long a,long long b)
{
    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()
{
    long long m,n;
    while(cin>>m>>n);
        cout<<gcd(m,n)<<" "<<lcm(m,n)<<endl;
    return 0;
}

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

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;
}
int P = a * b;
cout << bb << " " << P / bb << endl;

}
    return 0;
}

C++: #include <cstdio>

using namespace std;

#define max( a, b ) ( ( a > b ) ? a : b )
#define min( 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 = min( a, b ); 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;
}

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

int GCD(int, int);
int LCM(int ,int);

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

int GCD(int a, int b) {
  int c;
  do {
    if (a > b) {
      c = a %= b;
    } else {
      c = b %= a;
    }
  } while (c != 0);
  return a != 0 ? a : b;
}

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

int main(){
  long long a,b,c,l;
  while(cin>>a>>b){
    l = a*b;
    while(b){
      c = a;
      a = b;
      b = c % b;
    }
    cout<<a<<" "<<l/a<<endl;
  }
}

C++: #include <cstdio>
int a,b;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int main(){
    while(~scanf("%d%d",&a,&b)){printf("%d %lld\n",gcd(a,b),1LL*a*b/gcd(a,b));}
    return 0;
}

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

int main(){

	long long a = 0, b = 0;

	while (cin >> a >> b){
		long long gcd = 0;
		long long lcm = 0;
		long long r = 0;
		long long temp_a = 0, temp_b = 0;
		temp_a = a;
		temp_b = b;
		while ((max(temp_a, temp_b) % min(temp_a, temp_b)) != 0){
			r = (max(temp_a, temp_b) % min(temp_a, temp_b));
			temp_a = temp_b;
			temp_b = r;
		}
		gcd = min(temp_a, temp_b);
		lcm = (a / gcd) * b;
		cout << gcd << " "<< lcm << endl;

	}

	//getchar();

	return 0;
}

C++: #include <cstdio>

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

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

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	int a,b;
	while(cin>>a>>b){
		int lcm, gcd;
		
		int n=min(a,b);
		for(int i=n/2; i>=1; i--){
			if(!(a%i) && !(b%i)){
				gcd = i;
				break;
			}
		}
		lcm = a * (b / gcd);		//()必要。intの範囲のため
		
		cout<< gcd<< " "<< lcm<< endl;
	}

	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

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

int main(){
  long a, b;
  long ca, cb, tmp;
  long gcd, lcm;

  while(cin >> a){
    cin >> b;
    ca=a; cb=b;

    if(ca<cb){
      tmp=ca; ca=cb; cb=tmp;
    }

    while(cb!=0){
      ca%=cb;
      if(ca==0){
        ca=cb;
        break;
      }
      cb%=ca;
    }
    gcd=ca;
    lcm=a*b/gcd;

    printf("%d %d\n", gcd, lcm);
  }

  return 0;
}

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

int main() {
	for(long long a, b; scanf("%lld %lld", &a, &b) == 2;) {
		long long g = __gcd(a, b);
		printf("%lld %lld\n", g, a / g * b);
	}

	return EXIT_SUCCESS;
}

C++: #include <iostream>

using namespace std;

int gcd(int i, int j);

int main()
{
	int i,j;
	
	while(cin >> i >> j){
		int tmp;
		if(i>j){
			tmp = i;
			i = j;
			j = tmp;
		}
		int ret_gcd, ret_lcm;
		ret_gcd = gcd(i,j);
		ret_lcm = (i*j)/ret_gcd;
		
		cout << ret_gcd <<" " << ret_lcm <<endl;
		
	}
	return 0;
}

int gcd(int i, int j)
{
	
	if(j == 0){
		return i;
	}else{
		return gcd(j, i%j);
	}
	
}

C++: #include <bits/stdc++.h>
using namespace std;
int main ()
{
    long long int a,b,n,lcm;
    while (scanf ("%lld %lld",&a,&b)!=EOF)
    {
        n=__gcd(a,b);
        lcm=(a*b)/n;
        cout<<n<<" "<<lcm<<endl;
    }
}

C++: #include <iostream>
 
typedef unsigned int ui;
 
void swap(ui & a, ui & b)
{
    unsigned int tmp = a;
    a = b;
    b = tmp;
}
 
ui gcd(ui a, ui b)
{
    if (a < b) swap(a, b);
 
    ui c = a % b;
    while (c != 0) {
        a = b;
        b = c;
        c = a % b;
    }
 
    return b;
}
 
int main() {
    using namespace std;
 
    ui a, b;
    while (cin >> a >> b) {
        const ui GCD = gcd(a, b);
        const ui LCM = a * (b / GCD);
        cout << GCD << ' ' << LCM << endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
#define INF         1e9
#define EPS         1e-9
#define REP(i,n)    for(lint i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(lint i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(lint i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(lint i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define R_UP(a,b)   (((a)+(b)-1)/(b))
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP        cout << fixed << setprecision(8)
using namespace std;
using lint = long long;
template<typename T = lint>inline T in() { T x; cin >> x; return x; }
int gcd(int x,int y){
	return y==0?x:gcd(y,x%y);
}
int lcm(int x,int y){
	return x/gcd(x,y)*y;
}
signed main(){
	int a,b;
	while(cin>>a>>b){
		cout<<gcd(a,b)<<' '<<lcm(a,b)<<endl;
	}
}