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() {
		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;

int main() {
	int a, b, c, d, e, f, g, l;
	cin >> a >> b;
	c = a; d = b;
	e = a; f = b;
	while (1) {
		if (a>b) {
			a %= b;
			if (a == 0) { g = b; break; }
		}
		else if (a<b) {
			b %= a;
			if (b == 0) { g = a; break; }
		}
	}
	while (1) {
		if (c>d) d += f;
		else if (c < d) c += e;
		if (c == d) {l = c; break;}
	}
	cout << g << " " << l << endl;
}

C++: #include<iostream>
using namespace std;
int gcd(int a,int b) {
  if(a<b) {
    int tmp=a;
    a=b;
    b=tmp;
  }
  if(a%b==0) return b;
  return gcd(b,a%b);
}

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

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

int main() {

  long long int a,b;

  while( cin >> a >> b ) {

    long long int c,d;
    if ( a < b ) {
      c = b;
      d = a;
    }else {
      c = a;
      d = b;
    }

    while(true) {

      if ( c % d == 0 ) {
	break;
      }
      long long int k = c%d;
      c = d;
      d = k;

    }

    cout << d << " " << a/d*b << endl;

  }

  return 0;

}

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

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

int main(){
int a;
int b;
int c;
int d;
int e;
int f;
while(cin>>d>>e){
a=d;
b=e;
while(1){
c=a%b;
a=b;
b=c;
if(b==0){break;}
}
f=d/a*e;
cout << a <<" ";
cout << f <<endl;}}

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

int main(void)
{

	long a,b,ax,bx;

	while(scanf("%d %d", &a,&b) != EOF){

	if(a < b)
		swap(a,b);

	ax = a,bx = b;


	long c;
	while(ax % bx != 0){
		c = bx;
		bx = ax%bx;
		ax = c;
	}

	int ans;

	if(a % b == 0)
		ans = a;
	else
		ans = (a/bx)*(b/bx)*bx;

	cout << bx << ' ' << ans << endl;

	}

	return 0;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<int,ll> P;
typedef pair<ll,P> PP;

//-----------------------------------------------------------------------------

ll gcd(ll x,ll y) {
	if(x==0||y==0) return 0;
	ll r=0;
	while((r=x%y)!=0) x=y,y=r;
	return y;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll a,b;
	while(cin>>a>>b) {
		ll g=gcd(a,b);
		cout<<g<<' '<<a/g*b<<endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD (int) (1e9+7)
#define INF (int) 2e9

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

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

int gcd(int a, int b) {
  	int q,r;
	while(r==0){
	q=a/b;
	r=a%b;
	b=r;
	a=b;
	}
	return b;
}

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

C++: #include<iostream>
using namespace std;
int gcd(int a,int b) {
  if(a<b) {
    int tmp=a;
    a=b;
    b=tmp;
  }
  if(a%b==0) return b;
  return gcd(b,a%b);
}

int main() {
  int a=0;
  int b=0;
  while(cin>>a>>b) {
    int n=gcd(a,b);
    cout<<n<<" "<<a/(n*b)<<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 != 1){
int c = 0;
bb = bb % aa;
c = aa;
aa = bb;
bb = c;
}
cout << bb << " " << a * b / bb << endl;

}
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int *a, *b, p, q, i;
	a = &p;
	b = &q;
	while(cin >> p >> q){
		for(i = (*a > *b)? *b : *a; i >= 1; i--){
			if(*b%i == 0 && *a%i == 0){
				cout << i << " ";
				break;
			}
		}
		cout << ((*a)/i*(*b)) << endl;
	}
	
	return 0;
}

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

int main()
{
    unsigned long long a, b;

    while( cin >> a >> b )
    {
       for( int i = a; i > 0; i-- ) 
        {
                if( a % i == 0 && b % i == 0 ) 
                {
                    cout << i << " " << a * b / i << endl;
                    break;
                }
        }
    }
    return 0;
}

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


typedef long long ll;

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


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


int main(){
    while(true){
        ll a,b;
        cin >> a >> b;
        
        if(cin.eof()){
            break;
        }

        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int i;
int js(int x,int y)
{
    for(i=1; ;i++)
    {
        if(i%x==0&&i%y==0)
        {
            break;
        }
    }
    return i;
}
main()
{
    int n,k,j,max,min,x,y,t;
    while(~scanf("%d %d",&x,&y))
    {
        max=js(x,y);
        if(x>y)
            {
                t=x;
                x=y;
                y=t;
            }
        while(x!=0)
        {
            t=x;
            x=y%x;
            y=t;

        }
        min=y;
    printf("%d %d\n",min,max);
    }

}

C++: #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fi first
#define se second
#define pi acos(-1)
#define inf 0x3f3f3f3f
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define rep(i,x,n) for(int i=x;i<n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
using namespace std;
typedef pair<int,int>P;
const int MAXN=100010;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int main()
{
	ll a, b;
	while(cin >> a >> b)
	{
		ll c = __gcd(a, b);
		cout << c << " " << a / c * b << endl;
	}
 	return 0;
}

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

int main(){
    unsigned int a,b,c;
    cin>>a>>b;
    int g,l,p;
    p=a*b;
    while(b!=0){
        c=b;
        b=a%b;
        a=c;
    }
    g=a;
    l=p/g;
    cout<<g<<" "<<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 <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;

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