Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

//Min .
func Min(a, b int) int {
	switch a < b {
	case true:
		return a
	default:
		return b
	}
}

//GCDandLCM .
func GCDandLCM(i []int) (int, int) {
	a := i[0]
	b := i[1]

	for {
		if a == b {
			break
		} else {
			a, b = Min(a, b), int(math.Abs(float64(a-b)))
		}
	}

	return a, i[0] * i[1] / a
}

func main() {
	for sc.Scan() {
		i := Sliceconvtoi()
		g, l := GCDandLCM(i)
		fmt.Println(g, l)
	}

}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y){
	if(y == 0) return x;
	else return gcd(y, x % y);
}

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

C++: #include <cstdio>
#include <utility>
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <map>
#include <string.h>
 
using namespace std;

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

C++: #include <iostream>

using namespace std;

int GetGCD(int a, int b) {
    if (a < b) {
        auto temp = a;
        a = b;
        b = temp;
    }

    int r;
    while (true) {
        r = a % b;

        if (r == 0) return b;
        a = b;
        b = r;
    }
}

int GetLCMfromGCD(int a, int b, int gcd) {
    int e = a / gcd;
    return b * e;
}

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

C++: #include<iostream>
int a,b,t;int g(int a,int b){return a<b?g(b,a):(b?g(b,a%b):a);}
main(){while(std::cin>>a>>b)std::cout<<(t=g(a, b))<<' '<<(a/t)*b<<"\n";}

C++: #include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

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

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

C++: #include <stdio.h>

using namespace std;

int calcMax(int a,int b){
	int tmp;
	if(a > b){
		while(b != 0){
			tmp = b;
			b = a%b;
			a = tmp;
		}
		return a;
	}else{
		while(a != 0){
			tmp = a;
			a = b%a;
			b = tmp;
		}
		return b;
	}
}



int calcMin(int a,int b){
	int max_common = calcMax(a,b);
	return (a/max_common)*b;
}

int main(){
	int a,b;
	while(scanf("%d %d",&a,&b)!=EOF){
		printf("%d %d\n",calcMax(a,b),calcMin(a,b));
	}

    return 0;
}

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

int main(){
   int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1;
	   cin >> a >> b >>;
          seki = a*b;
	if(a == -1){
		break;
		}
	if(a < b){
		i = a;
		a = b;
		b = i;
		}
for(i = 1;i <= 50;i++){
   
if(b == 1){
  g = a;
  break;
  }
else {
 a = a%b;
 i = a;
 a = b;
 b = i;
 }
}
cout >> g >> " " >> seki / g >> endl;

    return 0;
}

C++: #include<iostream>
#define nijuoku 2000000000

using namespace std;


int saidaikouyaku(long long int a, long long int b){
    int big    = max(a,b);
    int little = min(a,b);
    
    for(long long int i = little; i > 1; --i){
        if(little % i == 0 && big % i == 0)return i;        
    }
    return -1;
}

int saisyoukoubai(long long int a, long long int b){
    
    int big    = max(a,b);
    int little = min(a,b);
    
    for(long long int i = big; i < nijuoku; i += big){
        if(i % little == 0)return i;        
    }
    return -1;
};


            
int main(){

    long long int a, b;
    
    while(cin >> a >> b){
        cout << saidaikouyaku(a,b) << ' ' << saisyoukoubai(a,b) << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(i=0;i<=50;++i){
  cin>>a>>b;
x=a;y=b;
while(1){
  if(x<y){y=y-x;}
  else if(x>y){x=x-y;}
  else if(x==y){break;}
}
L=(a*b)/x;
if(x==1){cout<<y<<" "<<y<<endl;}
else{cout<<y<<" "<<L<<endl;}
}
  return 0;
}

C++: #include <stdio.h>
int GCD(int a,int b){
	int r=a%b;
	if(r==0) return b;
	return GCD(b,r);
}
int main(){
	int a,b,g,l;
	while(scanf("%d%d",&a,&b)!=EOF){
		g = GCD(a,b);
		l = (a/g)*b;
		printf("%d %d\n",g,l);
	}
	return 0;
}

C++: #include<stdio.h>
int GCD (int a, int b) {
	return b ? GCD (b, a % b) : a;
}
int LCM (int a, int b) {
	return a / GCD (a, b) * b;
}
int main () {
	int a, b;
	while (~scanf("%d%d", &a, &b)) {
		printf("%d %d\n", GCD(a, b), LCM (a, b));
	}
	return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve
ll gcd(ll x, ll y){
  if(x > y)return gcd(y, x);
  if(x == 0)return y;
  return gcd(y % x, x);
}

int main(int argc, char const* argv[])
{
  ll x, y;
  while(cin >> x >> y){
    ll tmp = gcd(x, y);
    cout << tmp << " " << x * y / tmp << endl;
  }
	return 0;
}

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

int main() {
	double a, b, c, d;
	while(1) {
		cin >> a >> b;
		c = a;
		d = b;
		while (1) {
			if (fmod(max(a, b), min(a, b)) == 0) {
				cout << min(a, b);
				break;
			}else if(a > b) {
				a  = fmod(a,b);
			}else b = fmod(b,a);
		}
			cout << " " << c * d / min(a,b) << endl;
	}

	return 0;
}