Go: package main

import "fmt"

func main() {
	var gcdArr, lcmArr [50]int
	var count int
	for {
		var x, y int
		fmt.Scanf("%d %d", &x, &y)
		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
		}
		gcdArr[count] = y
		lcmArr[count] = lcm / y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%d %d\n", gcdArr[i], lcmArr[i])
	}
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	int a,b,c,a1,b1,p,min,max;
	while(cin>>a>>b)
	{
		if(a<b){p=a;a=b;b=p;}
		a1=a;b1=b;
		while(a%b!=0)
		{
			c=a%b;
			a=b;
			b=c;
		}
		min=b;
		max=a1*b1/b;
		cout<<min<<" "<<max<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
    long a,b,t,m,n,l;
    while(cin >> a >> b)
     {
        if(a>=b){
         m=a;
          n=b; 
        }
        else{
         n=a;
         m=b; 
        }
       while(n!=0)
        {
          t = n;
          n = m%n;
          m= t;
        }
        l = a*b / m;
        cout << m << l << endl;
      }
 return 0;
}

C++: #include<iostream>

using namespace std;


int main() {
	unsigned long long n, m,r,tempn,tempm;
	while (cin >> n >> m) {
		tempn = n, tempm = m;
		if (n < m) { int t = n; n = m; m = t; }
		while (m) {
			r= n % m;
			n = m;
			m = r;
		}
		cout << n << ' ';
		int i;
		for (i = 1; (i*tempn) % tempm != 0; ++i);
			cout << tempn * i << endl;

	}
	return 0;
}

C++: #include<stdio.h>


int main(){
	long long int x,y;
	long long int i,j;
	while(scanf("%lld%lld",&i,&j),i){
		x=i,y=j;
		while(i==j){
			if(i>j){
				i=i-j;
			}else{
				j=j-i;
			}
		}
		y=x*y/i;
		x=i;


		printf("%lld %lld\n",x,y);
	}

	return 0;
}

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

int u(int a, int b);
int l(int a, int b);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    gcd = u(a, b);
    lcm = l(a, b);
printf("%d %d\n",lcm, gcd);
    //std::cout << lcm << " " << gcd << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(a==1 || b==1){
    if(a>=b){
      a = a % b;
    }else{
      b = b % a;
    }
  }
  
  if(a==1) return b;
  else     return a;
}

int l(int a, int b){
  int i = 2;
  
  while(1){
    if(a%i==0){
      if(b%i==0){return i;}
      else{i++;}
    }else{
      i++;
    }
  }
}

C++: #include <cstdio>
#include <algorithm>

using namespace std;

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

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

C++: #include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int gcd(int x,int y){
	while(y){
		int t=x%y;
		x=y;
		y=t;
	}
	return x;
}
int main()
{
	int n,m;
	while(scanf("%d%d",&n,&m)==2){
		int x=gcd(n,m);
		printf("%d %d\n",x,n/x*m);
	}
}

C++: #include<stdio.h>
#include<string.h>
#include<iostream> 
#include<queue>
#include<vector> 
#include<algorithm>
#include<utility>
#include<cmath>
#define inf 0x3f3f3f3f
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
ll gcd(ll a,ll b){
	ll t;
	while(b!=0){
		t=a;
		a=b;
		b=t%b;
	}
	return a;
}
int main()
{
	ll a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF){
		ll Gcd=gcd(a,b);
		ll Lcm=a*b/Gcd;
		printf("%lld %lld\n",Gcd,Lcm);
	} 
    return 0;
}

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

int GCD(int a, int b){
	return (b == 0) ? a:GCD(b, a%b);
}
int LCM(int a, int b){
	return a/GCD(a, b)*b;
}

int main(){
	int a, b;
	while(cin >> a >> b){
		if(a < b)
			swap(a, b);
		cout << GCD(a, b) << " " << LCM(a, b) << endl;
	}
	return 0;
}

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

int main(){
	long long a, b, c;
	long long x, y;

	while (cin >> a >> b){
		if (a > b){
			x = a;
			y = b;
		}
		else{
			x = b;
			y = a;
		}
		while (x % y != 0){
			c = x;
			y = c % y;
			x = c;
		}

		cout << y << " " << (a * b / y) << endl;
	}

}

C++: #include<cstdio>
int gcd(int a,int b)
{
	if(b==0)return a;
	else return gcd(b,a%b);
}
int main()
{
	int n,m;
	while(scanf("%d%d",&n,&m)==2)
	{
		int d = gcd(n,m),ans = n/d*m;
		printf("%d %d\n",d,ans);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main() {
  int a, b, m, tmp_a, tmp_b;
  while (cin >> a >> b) {
    tmp_a = a;
    tmp_b = b;
    while (tmp_a != 0 && tmp_b != 0) {
      if (tmp_a > tmp_b) {
        tmp_a = tmp_a % tmp_b;
      } else {
        tmp_b = tmp_b % tmp_a;
      }
    }
    m = max(tmp_a, tmp_b);
    if (m == 0) {
      printf("%d %d\n", 0, 0);
    } else {
      printf("%d %d\n", m, a * b / m);
    }
  }
  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 <iostream>
using namespace std;

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

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

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

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

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

C++: #include<iostream>
#include<cstdio>

long long gcd (long long a, long long b) {
  if(a < b) {
    int foo = a;
    a = b;
    b = foo;
  }

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

int main() {
  long long a ,b;

  while (scanf("%ld %ld", &a, &b) == 2) {
    long long g = gcd(a, b);
    printf("%ld %.3lf\n", g, a * b / g);

  }

  return 0;
}

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

long long gcd(long long a, long long b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}
int main(void){
    long long a, b;
    while(cin >> a >> b){
        long long s = gcd(a, b);
        cout << s << " " << a*b/s << endl;
    }
    return 0;
}

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

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

int main(){
	long long a,b;
	vector<long long*> output;
	while(!cin.eof()){
		cin >> a >> b;
		long long g[2];
		g[0] = gcd(a,b);
		g[1] = a*(b/g[0]);
	}
	vector<long long*>::iterator it = output.begin();
	for(;it != output.end();++it)
		cout << (*it)[0] << " " << (*it)[1] << endl;

	return 0;
}

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

int main() {
	unsigned long a, b, mod, big, small;
	while (cin >> a >> b) {
		if (a > b) {
			int stock = a;
			a = b;
			b = stock;
		}
		big = a;
		small = b;
		while (a % b != 0) {
			mod = a % b;
			a = b;
			b = mod;
		}
		cout << b << " " << big / b * small << endl;
	}
}

C++: #include <iostream>

using namespace std;
typedef long long ll;
ll gcd(ll a,ll b)
{
    return b>0?gcd(b,a%b):a;
}
ll lcm(ll a,ll b)
{
    return a/gcd(a,b)*b;
}
int main()
{
    ll a,b;
    while ((cin>>a>>b)>0)
    {
        ll GCD=gcd(a,b);
        cout<<GCD<<" "<<a/GCD*b<<endl;
    }
    return 0;
}