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 <cstdlib>
#include <iostream>
#include <iomanip>
#include <stdio.h>

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

    long a,b,c,d;
    while (std::cin >> a >> b) {
        if (a > b){
            c = a;
            d = b;
        }else{
            c = b;
            d = a;
        }
        long temp;
        while (c % d != 0){
            temp = d;
            d = c % d;
            c = temp;
        }
        std::cout << d << " " << a*b/d << std::endl;
    }
    return EXIT_SUCCESS;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++) 
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int lcm( int a, int b )
{
	int temp = __gcd( a, b );

	return temp ? ( a / temp * b ) : 0;
}
int main()
{
	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(){
  int a, b;

  while(cin >> a >> b){
    int g = __gcd(a, b);
    int l = a / g * b;

    cout << g << " " << l << endl;
  }
}

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

int getGcd(int x, int y){
  if(y==0) return x;
  getGcd(y,x%y);
}

int getLcm(int x, int y){
  for(int i=1;;i++)
    if(i%x==0 && i%y==0) return i;
}

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

C++: #include <cstdio>
#include <stdlib.h>
#include <algorithm>
#define min(a,b)    (((a) < (b)) ? (a) : (b))
#define max(a,b)    (((a) > (b)) ? (a) : (b))
#define abs(x)    ((x) < 0 ? -(x) : (x))
#define INF 0x3f3f3f3f
#define delta 0.85
#define eps 1e-3
#define PI 3.14159265358979323846
#define MAX_V 10005
#define MAX_E 10000000
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)){
		int c = gcd(a, b);
		printf("%d %d\n", c, a * (b / c));
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
	long long a, b;
	while(cin>>a>>b)
	{
		cout<<__gcd(a,b)<<" "<<(a * b) / __gcd(a,b)<<endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
ll gcd(ll a,ll b)
{

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

}

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

using namespace std;

typedef long long ll;

ll gcd(const ll sx, const ll sy) {
    ll x = min(sx, sy);
    ll y = max(sx, sy);
    ll tmp;
    while (x > 0) {
        tmp = y;
        y = x;
        x = tmp % x;
    }
    return y;
}

ll lcm(const ll x, const ll y) {
    return x / gcd(x, y) * y;
}

// ref. http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005
int main(void) {
    char buf[1024];
    int res;
    while (1) {
        if (fgets(buf, 1024, stdin) == NULL) {
            if (feof(stdin)) {
                return 0;
            } else {
                perror("fgets");
                return 1;
            }
        }

        ll x, y;
        sscanf(buf, "%lld %lld", &x, &y);
        cout << gcd(x, y) << " " << lcm(x, y) << endl;
    }
}

C++: // B.cpp

#include <iostream>

using namespace std;

int gcd(int, int);
int lcm(int, int);

int main(void) {
	int a, b;
	cin >> a >> b; 
	cout << gcd(a, b) << " " <<  lcm(a, b) << endl;

	return 0;
}

int gcd(int a, int b) {
	int max, min, res;
	
	res = 1;
	
	if(a > b){
		max = a, min = b;
	}
	if(a <= b){
		max = b, min = a;
	}
	if(min == 0) return max;
	while(res) {
		res = max % min;
		max = min;
		min = res;
	}
	return max;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define N 2000000000
int main() {
	long long int a,b;
	while(cin>>a>>b){
		int* ahoge;
		int* bhoge;
		ahoge=(int*)malloc(sizeof(int)*N);
		bhoge=(int*)malloc(sizeof(int)*N);
		long long int i,j;
		for(i=2;i<=a;i++){
			if(a%i==0){
				int count=0;
				do{
					a=a/i;
					count++;
				}while(a%i==0);
				ahoge[i]=count;
			}	
		}
		for(j=2;j<=b;j++){
			if(b%j==0){
				int count=0;
				do{
					b=b/j;
					count++;
				}while(b%j==0);
				bhoge[j]=count;
			}	
		}
		long long int great,least,k;
		great=1;
		least=1;
		for(k=2;k<min(i,j);k++){
			great=great*pow(k,min(ahoge[k],bhoge[k]));
		}
		for(k=2;k<max(i,j);k++){
			least=least*pow(k,max(ahoge[k],bhoge[k]));
		}
		cout<<great<<" "<<least<<endl;
	}
	return 0;
}

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

bool gcd(int u, int v)
{
  int r, z;

    if(v > u)
    {
      z = u;
      u = v;
      v = z;
    }

  while((r = u%v) != 0)
  {
    u = v;
    v = r;
  }    
  return v;  
}


int main(void)
{
  int a, b, lcm;

  while(scanf("%d %d", &a, &b))
  {      
    lcm = b/gcd(a,b)*a;
    printf("%d %d\n", gcd(a,b), lcm);
  }

  return 0;
}

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

    cout<<gcd(a,b)<<" ";
        cout<<a/gcd(a,b)*b<<endl;}
    return 0;
}

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

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

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

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

using namespace std;

int main()
{
	unsigned long a, b, r, c, d;
	unsigned long ta, tb;

	scanf("%d%d", &a,& b);
	if (a > b){
		ta = a;
		tb = b;
	} else {
		ta = b;
		tb = a;
	}
	

	while (1) {
	r = ta % tb;
	if (r == 0) break;
	ta = tb;
	tb = r;
	}
	c = tb;

	
	d = a * (b  / c);
	

	printf("%d %d\n", c, d);

	return (0);
}

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

using namespace std;

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

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

C++: #include <iostream>
#include<string>
using namespace std;
void hideki(int x,int y){
    
}

int main(){
    int a,b;
    cin>>a>>b;
    int d=a*b;
    if(a>b)
    while(a%b!=0&&a>b){a=a%b;}
    else
    while(b%a!=0&&b>a){b=b%a;}
    int c=min(a,b);
    cout<<c<<" "<<d/c<<endl;
    
    return 0;
}

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