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 <iostream>
#include <cstdio>
using namespace std;

int main(void)
{
  long long unsigned int a, b, x, y, gcd, lcm, r;

  while(scanf("%llu %llu", &a, &b) != EOF)
    {
      r = 1;
      x = a;
      y = b;

      while(r != 0)
	{
	  r = x % y;
	  x = y;
	  y = r;
	}
      gcd = x;

      lcm = a * b / gcd;

      cout << gcd << " " << lcm << endl;
    }
  return 0;
}

C++: #include<iostream>

int main(){
	int a[44722],b,c,d,e=0,f=1;
	while(std::cin >> b >> c){
	for(d=2;d*d<=b||d*d<=c;){
		if(b%d==0&&c%d==0){
			a[e] = d;
			e++;
			b = b / d;
			c = c / d;
		}else break;
	}
	for(d=3;d*d<=b||d*d<=c;d=d+2){
		while(1){
			if(b%d==0&&c%d==0){
			a[e] = d;
			e++;
			b = b / d;
			c = c / d;
			}else break;
		}
	}
	a[e] = 0;
	for(e=0;a[e]>0;e++){
		f = f * a[e];
	}
	std::cout << f;
	f = f * b * c;
	std::cout << " " << f << std::endl;
	e = 0;
	f = 1;
	}

	return 0;
}

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

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

unsigned GCD(unsigned a, unsigned b)
{
	unsigned s=(a<b)?a:b, l=(a<b)?b:a;
	unsigned gcd=1;
	for(unsigned i=2; i<=s; ++i)
	{
		while(s%i==0 && l%i==0)
		{
			s/=i;
			l/=i;
			gcd*=i;
		}
	}
	return gcd;
}

unsigned LCM(unsigned a, unsigned b)
{
	unsigned large = (a<b)?b:a;
	unsigned x = large;
	for(unsigned i=1; x<2000000000; ++i)
	{
		if(x%a==0 && x%b==0)
		{
			return x;
		}
		x+=large;
	}
}

int main()
{
	double a,b;
	while(cin>>a>>b)
	{
		cout << GCD(a,b) << ' ' << LCM(a,b) << '\n';
	}
}

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

//max 
long int gcd(long int a, long int b){
    if((a==0 || b==0)) return 0;
    while(a!=b){
        if(a>b) a=a-b;
        else b=b-a;
    }
    return a;
}

//min
long int lcm(long int a, long int b){
    if((a==0||b==0)) return 0;
    return ((a / gcd(a, b)) * b);
}
int main(void){
    long 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()
{
	int a,b,gcd,lcm;
	while (cin >> a >> b)
	{
		for (int i = a; i > 0; i--)
		{
			if (b%i == 0&&a%i==0)
			{
				gcd = i;
				break;
			}
		}
		for (int j = a;; j++)
		{
			if (j%a == 0 && j%b == 0)
			{
				lcm = j;
				break;
			}
		}
		cout << gcd << " " << lcm << endl;
	}
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
	long long a,b,s,m,ta,tb,tmp;
	while(cin>>a>>b){
	ta=a,tb=b;
	s=0,m=0;
	if(a<b)swap(a,b);
	if(a==0||b==0){
	
	}
	else 
	while(true){
		tmp=a;
		a=b;
		b=tmp%a;
		if(a%b==0){
			m=b;
			break;
		}
		if(a<b){
		//cout<<a<<" "<<b<<endl;
		m=1;
		break;
		}
	}
		
		s=(ta*tb)/m;
		cout<<m<<" "<<s<<endl;
	}
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int gcd(int a,int b){
	int n;
	n = a%b;
	if (n == 0)return b;
	else return gcd(b, n);
}
int main() {
	int a, b, c, n,s;
	while (cin >> a >> b) {
		if (a > b)n = gcd(a, b);
		else n = gcd(b, a);
		s = a / n*b;
		cout << n << " " << s << endl;
	}
	return 0;
}

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

int lcm(int n, int m) {
    if (n < m) swap(n, m);
    if (m == 0)
        return n;
    else
        return lcm(m, n % m);
}

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

C++: #include<iostream>

using namespace std;

int main(){
	int a,b,ta,tb,tc;
	while(cin >> a>>b){
		ta=a;
		tb=b;
		while(1){
			if(ta<tb){
				tc=ta;
				ta=tb;
				tb=tc;
			}
			tc=ta%tb;
			if(tc==0)break;
			ta=tb;
			tb=tc;
		}
		cout << tb<< " "<< a*b/tb <<endl;
	}
	return 0;
}

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

inline u_long lcm(const u_long a, const u_long b) {
    return a * b / std::__gcd(a, b);
}

int main(void) {
    u_long a, b;

    while (std::cin >> a >> b) {
        std::cout << std::__gcd(a, b) << " " << lcm(a,b) << std::endl;
    }

    return 0;
}