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 <iomanip>
using namespace std;

void GetGCD(int a, int b, int& GCD)
{
	if(a == 0){
		GCD = b;
		return;
	}
	if(b == 0){
		GCD = a;
		return;
	}
	if(a >= b){
		a = a % b;
	}else{
		b = b % a;
	}
	GetGCD(a, b, GCD);
}

int main()
{
	while(true){
		int a, b;
		cin >> a >> b;
		if(cin.eof()) break;
		int GCD;
		GetGCD(a, b, GCD);
		int LCM = a * (b / GCD);
		cout << GCD << ' ' << LCM << endl;
	}
	return 0;
}

C++: #include <cstdio>

//input
int a, b;

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

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

void solve(){
	printf("%d %d\n", gcd(a, b), lcm(a, b));
}

int main(int argc, char const *argv[]){

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

	return 0;
}

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

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

using namespace std;

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

int main(void){
    int a, b, tmp;
   
     if(a<b){
        tmp = a;
        a = b;
        b = tmp;
        }
     
     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(b==0){
	return a;
 }
 return gcd(b,a%b);
}

int main()
{
 while(1){
	int a,b;
	cin>>a>>b;

	if(cin.eof()) break;
	if(a==0||b==0)break;
	
	int g=gcd(a,b);
	cout<<g<<' '<<a/g*b<<endl;
 }
 return 0;
}

C++: #include <stdio.h>
int gcd(long long int x,long long int y)
{
    long long int tem;
    while(y!=0)
    {
        tem=y;
        y=x%y;
        x=tem;
    }
    return x;
}
int main()
{
    long long int a,b,x,y,l,g;
    while(scanf("%lld%lld",&a,&b)==2)
    {
        g=gcd(a,b);
        l=(a*b)/g;
        printf("%lld %lld\n",g,l);
    }
    return 0;
}

C++: /*
 0005-GCD_and_LCM.cpp
 
 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005
 */

#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int a,b;
    while(cin>>a>>b){
        long int temp_a = a;
        long int temp_b = b;
        while(1){
            long int l = max(temp_a,temp_b);
            long int r = min(temp_a,temp_b);
            l = l-r;
            if(l==r){
                cout<<l<<" "<<a/l * b/l * l <<endl;
                break;
            }else{
                temp_a = l;
                temp_b = r;
            }
        }
    }
}

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


long long int GCM(long long int a,int long long b){
	while(a!=b){
		a>b? a-=b:b-=a;
	}
	return a;
}

int main()
{
	ifstream ifs("Text.txt");
	long long int a,b,L,G;
	
	
	ifs>>a;
	do{
	ifs>>b;
	G=GCM(a,b);
	L=a*b/G;
	cout<<G<<" "<<L<<endl;
	}while(ifs>>a);
	cin>>a;
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define int long long

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

unsigned main(){
    int A,B;
	while(cin>>A>>B){
		printf("%lld %lld\n",gcd(A,B),A*B/gcd(A,B));
	}
    return 0;
}

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


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

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

long long GCD(unsigned long long a,unsigned long long b){
	if(b==0)return a;
	unsigned long long alt=a%b;
	GCD(b,alt);
}

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

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

long int GCD(long int a, long int b){
  if(a < b){long int c = a; a = b; b = c;}
  while(true){
    long int c = a % b;
    if(c == 0) return b;
    a = b;
    b = c;
  }
  return 0;
}

long int LCM(long int a, long int b){
  return a * b / GCD(a, b);
}

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

C++: #include<iostream>

int main(){
	long int a, b, r;
	
	while(std::cin >> a >> b){
		long int product = a*b;
		
		// GCD
		if(a < b){
			long int temp = a;
			a = b;
			b = temp;
		}
		while((r = a%b) != 0){
			a = b;
			b = r;
		}
		
		// LCM
		long int lcm = product / b;
		
		// show
		std::cout << b << ' ' << lcm << std::endl;
	}
	
	return 0;
}

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

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

long int a,b;

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

int main(){
    while(cin){
        cin >> a >> b;
        if(!cin) break;
        long int ans = gcd(a,b);
        cout << ans << " " << (a*b)/ans << endl;
    }
}

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

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

int main(void){
    int a, b, tmp;
    if (a < b){
        tmp = b;
b = a;
a = tmp;

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

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

u_int euclid_alg(const u_int a, const u_int b) {
	return a > b ? a % b : b % a;
}

int main(void) {
	u_int a,b;
	std::vector<u_int> num;
	while(std::cin >> a >> b){
		num.push_back(a);
		num.push_back(b);
	}

	for(int i = 0; i < (int)num.size(); i+=2){
		u_int pro = num[i] * num[i+1];
		while(num[i] != 0 && num[i+1] != 0){
		if(num[i] > num[i+1]){
				num[i] = euclid_alg(num[i],num[i+1]);
			}else{
				num[i+1] = euclid_alg(num[i],num[i+1]);
			}
		}

		if(num[i] == 0){
			num[i] = num[i+1];
			num[i+1] = 0;
		}
		num[i+1] = pro / num[i];
	}

	for(int j = 0; j < (int)num.size(); j+=2){
		std::cout << num[j] << " " << num[j+1] << std::endl; 
	}

	return 0;
}

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

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

int main()
{
  unsigned int a, b;


  while (cin >> a >> b)
  {
    if (a < b)
    {
      int t = a;
      a = b;
      b = t;
    }

    int g = gcd(a,b);
    int l = a * (b / g);

    cout << g << ' ' << l << endl;
  }
  return 0;
}