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 <boost/math/common_factor_rt.hpp>
using namespace std;
using namespace boost::math;

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

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

using namespace std;
int solveGCD(int a, int b);

int a, b, tmp;

int main() {
  while(1) {
    scanf("%d %d", &a, &b);
    if(a<b) {tmp=a; a=b; b=tmp;}
    int gcd = solveGCD(a, b); 
    printf("%d %d\n", gcd, a/gcd*b);
  }
}

int solveGCD(int a, int b) {
  return b ? solveGCD(b, a%b) : a;
}

C++: #include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <sstream>
using namespace std;

#define PQ priority_queue
#define P pair<int,int>
#define CLA(array) memset(array,0,sizeof array)
#define CLINF(array) memset(array,0x3f,sizeof array)
#define CLF(array) memset(array,-1,sizeof array)
#define DB(a) cout << "DEBUG " << a << endl;
typedef long long LL;
const int MAXN = 100000 + 50;
const int INF = 1 << 30;
LL gcd(LL a,LL b){
	if(a < b) swap(a,b);
	return b == 0 ? a : gcd(b,a % b);
}

int main(){
    //ios_base::sync_with_stdio(false);
	LL n,m;
	while(~scanf("%lld%lld",&n,&m)){
		LL ans = gcd(n,m);
		printf("%lld %lld\n",ans,n / ans * m);
	}


    return 0;
}

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

typedef long long ll;

ll gcd(ll a, ll b) {
    if(b == 0) return(a);
    return(gcd(b, a % b));
}
ll lcm(ll m, ll n) {
    if(m == 0 || n == 0) return(0);
    return(m * n / gcd(m, n));
}
int main(void) {
    int a, b;
    
    while(scanf("%d %d", &a, &b) != EOF) {
        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 >> b){
		long long gcd;
		long long c = max(a, b);
		long long d = min(a, b);
		while (true){
			if (c % d == 0) {
				gcd = d;
				goto C;
			}
			else{
				c -= d;
				swap(c, d);
			}
		}
	C:
		cout << gcd << ' ' << a*b / gcd << endl;
	}
}

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

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

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

int main(){
	long long int x, y;
	while (cin >> x >> y) {
		long long int a, b, c;
		a = max(x, y);
		b = min(x, y);
		c = a % b;
		while (c) {
			a = b;
			b = c;
			c = a % b;
		}
		cout << b << ' ' << x * y / b << endl;
	}
	return 0;
}

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

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

C++: /*
  GCD and LCM
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;

int n,m;

int gi() {
  int x=0,o=1; char ch=getchar();
  while(ch!='-' && (ch<'0' || ch>'9')) ch=getchar();
  if(ch=='-') o=-1,ch=getchar();
  while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
  return o*x;
}

int gcd(int x, int y) {
  return y?gcd(y,x%y):x;
}

int main() {
  while(scanf("%d%d", &n, &m)!=EOF) {
    int g=gcd(n,m);
    printf("%d %d\n", g,n/g*m);
  }
  return 0;
}

C++: #include<stdio.h>
int main(){

	long long int a,b,x,y;
	while(~scanf("%lld%lld",&a,&b))
	{
	x=a;
	y=b;
	while(a!=b){
		if(a>b){
			a-=b;
		}
		else{
			b-=a;
		}
	}
	printf("%lld %lld",a,x/a*y);
}	
return 0;
	}

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

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

C++: #include<iostream>
using namespace std;
int gcd(int a,int b)
{
	return a==b?a:gcd(b,a%b);
}
int main()
{
	int a,b,d;
	cin>>a>>b;
	d=gcd(a,b);
	cout<<d<<" "<<a/d*b;
	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(){
	int a, b;
	while((scanf("%d%d",&a,&b))!=EOF){
		int c=gcd(a, b);
		int d=(a/c)*b;
		printf("%d %d\n",c,d);
	}
}

C++: #include <iostream>
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 a, b;
 
    while( cin >> a >> b ){
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
    }
}

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

long GCD(long, long);
long LCM(long, long);

long gcd, lcm;

int main(){
	long a, b;
	while(cin >> a >> b){
		if(a < b)
			swap(a, b); // a > b
		gcd = GCD(a, b);
		lcm = LCM(a, b);
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}

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

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

C++: #include <cstdio>
#define llong long long

int main() {
  llong a,b;
  while(scanf("%lld %lld", &a, &b) != EOF) {
    llong lcm = a*b;
    while(a != 0 && b != 0) {
      if(a >= b) a = a%b;
      else b = b%a;
    }
    llong gcd = a+b;
    lcm /= gcd;
    printf("%lld %lld\n", gcd, lcm);
  }
  return 0;
}

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


int main(){
	int a, b, tmp, x, y, z;
	while (true){
		cin >> a >> b;
		if (cin.eof()){
			break;
		}
		if (a < b){
			 tmp = a;
			 x = b;
		}
		else {
			x = a;
			tmp = b;
		}
		while (tmp != 0) {
			y = tmp;
			tmp = x % y;
			x = y;
		}
		z = a / y * b;
		cout << to_string(y) << " " << to_string(z) << endl;
	}
	return 0;
}

C++: #include <cstdio>
int main(){
	long a,b,x,y;
	while (~scanf("%ld%ld", &a, &b)) {
		for(x=a,y=b; x%=y; x^=y^=x^=y);
		printf("%ld %ld\n", y, a*b/y);
	}
}

C++: #include<iostream>
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,l;
    while(cin>>a>>b){
        g=gcd((a>=b)?a:b,(a>=b)?b:a);
        l=(a/g)*b;
        cout<<g<<" "<<l<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long int a = 0;
	long long int b = 0;
	while (cin >> a, cin >> b)
	{
		long long int c = 0;
		long long int d = 0;
		long long int e = 0;
		c = a;
		d = b;
		if (c < d)
		{
			long long int i = 0;
			i = d;
			d = c;
			c = i;
		}
		while (1)
		{
			e = c % d;
			if (e == 0)
			{
				break;
			}
			c = d;
			d = e;
		}
		cout << d << " " << a / d * b << endl;
	}
	
	return 0;
}