Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		row := strings.Fields(scanner.Text())
		nums := []int{}

		for _, v := range row {
			num, _ := strconv.Atoi(v)
			nums = append(nums, num)
		}
		fmt.Println(gcd(nums[0], nums[1]), lcm(nums[0], nums[1]))
	}
}

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


int main()
{
	int a[100],b[100];
	int i=0;
	while(cin >> a[i] >> b[i]){i++;}
	for(int j=0;j<i;j++){
		int c;
		int d=a[j],e=b[j];
		if (a[j]<b[j]){c=a[j];a[j]=b[j];b[j]=c;}
		while(a[j]%b[j]!=0){
			c=a[j];
			a[j]=b[j];
			b[j]=c%b[j];
		}
		cout << b[j] <<" " <<d*e/b[j] <<  endl;
	}
    return 0;
}

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

using namespace std;

int gcd(int a,int b)
{
    if(b <= 1 || a == b)
        return a;
    else
        return gcd(b,a%b);
}
int lcm(int a, int b)
{
    int g = gcd(a,b);
    return (a / g) * b;
}

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

C++: #include <stdio.h>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;
#define MAX 1000010
long long gcd(long long a,long long b)
{
    if(a%b==0)
        return b;
    else
        return gcd(b,a%b);
}
int main()
{
    long long a,b;
    while(~scanf("%lld%lld",&a,&b))
    {
        long long ans=gcd(a,b);
        printf("%lld %lld\n",ans,a/ans*b);
    }
    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;
     
     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 main(){

	int a,b,GCD,LCM,c;

	while(cin>>a>>b){

		if(a>b){
			c=b;
		}
		else{
			c=a;
		}

		for(int i=1;i<=(c/2+1);i++){
			if(b%i==0 && a%i==0){
				GCD = i;
			}
		}
		if(b%a==0 || a%b==0){
			GCD = c;
		}
		LCM=a*b/GCD;
		cout<<GCD<<" "<<LCM<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
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 / GCD(a, b) * b;
}

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

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

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

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

using namespace std;

typedef long long int llongi;

llongi GCD(const llongi& a, const llongi& b) {
	if (a%b == 0) {
		return b;
	}
	GCD(b, a%b);
}

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
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() {
  ll a, b;
  while (true) {
    cin >> a >> b;
    if (cin.eof()) break;
    cout << gcd(a, b) << " " << lcm(a, b) << endl;
  }
  return 0;
}

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

int main() {
	// your code goes here
	long long int a,b;
	long long int miner,maxer;
	while(cin >> a >> b){
		int a2=a,b2=b;
		while(max(a2,b2)%min(a2,b2)!=0){
			if(a2>b2)
			a2=a2-b2;
			else
			b2=b2-a2;
		}
		miner =min(a2,b2);
		cout << miner << endl;
		cout << a*b/miner << endl;
	}
	return 0;
}

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

C++: #include <iostream>

using namespace std;

int main() {
    int a,b,big,small,r;

    while(1){
        cin >> a >> b;
        if(cin.eof()){
            break;
        }
        
        if(a > b){
            big = a;
            small = b;
        }
        else {
            big = b;
            small = a;
        }
        
        r = big % small;
        while(r != 0){
            big = small;
            small = r;
            r = big % small;
        }
        
    }
    
    cout << small << ' ' << (a / small) * (b / small) * small << endl; 

    return 0;
}

C++: #include <algorithm>
#include <iostream>
using namespace std;
int main() {
	long long a, b;
	while (cin >> a >> b) {
		cout << __gcd(a,b) << " " << a / __gcd(a,b) * b << "\n";
	}
}

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

C++: #include <iostream>

using namespace std;

int main()
{
	int a, b, c, r;
	int gcd, lcm;

	while (cin >> a >> b){
		if (b > a){
			c = a; 
			a = b; 
			b = c;
		}

		lcm = a * b;
		while (1){
			r = a % b;

			gcd = b;
			if (r == 0){
				break;
			}
			a = b;
			b = r;
		}

		lcm /= gcd;
		cout << gcd << " " << lcm << endl;
	}

	return 0;
}

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

int GCD(int value1,int value2){
    int large,small;
    
    if(value1>=value2){
        large=value1;
        small=value2;
    }else{
        large=value2;
        small=value1;
    }
    
    if((large%small)==0){
        return small;
    }else{
        return GCD(small,large%small);
    }
}

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

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

int gcd(int a,int b)
{
    int l,s,r;
    if (a<b)
    {
	l=b;
	s=a;
    } else {
	l=a;
	s=b;
    }
    while(true)
    {
	r=l%s;
	if (r == 0) break;
	l=s;
	s=r;
    }
    return s;
}

int main()
{
    int a,b;
    vector<int> r1,r2;
    while (scanf("%d %d",&a,&b) != EOF)
    {
	r1.push_back(gcd(a,b));
	r2.push_back(a/r1[r1.size()-1]*b);
    }
    for (int i=0; i<r1.size(); i++)
    {