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()
{
	unsigned long a, b, r, c, d;
	unsigned long ta, tb;
	int i = 0;


	while (1) {
		i ++;
		scanf("%d%d", &a,& b);
		if (i == 3) break;
	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++: // 2011/05/31 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int a, b;
		cin >> a;
		if(cin.eof())
			break;
		cin >> b;

		int m, n;
		if(a>=b){
			m = a;
			n = b;
		}
		else{
			m = b;
			n = a;
		}

		while(m%n!=0){
			int tmp = n;
			n = m%n;
			m = tmp;
		}

		int gcd = n;
		int lcd = a/gcd*b;

		cout << gcd << ' ' << lcd << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int gcd(int a, int b) {
    int t;
    while (b) {
        t = a % b;
        a = b;
        b = t;
    }
    return a;
}

int main() {

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

    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
long long gcd(long long x, long long y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int main()
{
	long long a,b;
	while (cin >> a>>b) {
		long long c, d;
		c = gcd(a, b);
		d = c*(a / c)*(b / c);
		cout << c <<' '<< d << endl;
	}
	return 0;
}

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main() {
  int a, b, m, tmp_a, tmp_b;
  while (cin >> a >> b) {
    tmp_a = a;
    tmp_b = b;
    while (tmp_a != 0 && tmp_b != 0) {
      if (tmp_a > tmp_b) {
        tmp_a = tmp_a % tmp_b;
      } else {
        tmp_b = tmp_b % tmp_a;
      }
    }
    m = max(tmp_a, tmp_b);
    if (m == 0) {
      printf("%d %d\n", 0, 0);
    } else {
      printf("%d %d\n", m, a / m * b);
    }
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#define MAX 500000
using namespace std;


int main()
{
	long long int a, b;
	while (cin >> a >> b){
		long long int gcm = 1;
		bool flag = true;
		while (flag){
			for (int i = 2;; i++){
				if (a % i == 0 && b % i == 0){
					gcm = gcm * i;
					a = a / i;
					b = b / i;
					break;
				}
				if (i == min(a, b)){
					flag = false;
					break;
				}
			}
		}
		long long int lcm = gcm * a * b;
		cout << gcm << " " << lcm << endl;
	}
	return 0;
}

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

C++: 
#include <iostream>

using namespace std;

typedef unsigned long long ull;

int main()
{
	ull a, b, t;
	while(scanf("%llu", &a)+1)
	{
		scanf("%llu", &b);
		ull M = a > b ? a : b;
		ull m = a < b ? a : b;
		while(m != 0)
		{
			t = M % m;
			M = m;
			m = t;
		}

		printf("%llu %llu\n", M, a / M * b);
	}
}

C++: #include <iostream>
using namespace std;
 
int gcd(int a, int b) {
return a % b ? gcd(b, a % b) : b;
}
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<stdio.h>

int gcd(int one, int two){		//Ååöñ
	
	int temp,mod;
	
	if(one<two){
		temp=one;
		one=two;
		two=temp;
	}
	
	while(1){
		
		if(two==0){
			return one;
		}
		
		else{
			mod=one%two;
			one=two;
			two=mod;
		}
	}
}


int lcm(int one, int two){		//Å¬ö{
	
	int r;
	
	r=(one*two)/gcd(one,two);
	
	return r;
}
	
int main(void){

	int first,second;
	int j,k;

	while(1){
		
		scanf("%d %d",&first,&second);
		
		if(first==0||second==0){
			break;
		}
	
		j=gcd(first,second);
		k=lcm(first,second);

		printf("%d %d\n",j,k);
	}
	
	return 0;
}

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

typedef long long ll;

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

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

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

int main()
{
	long long a,b;
	while(cin>>a>>b)
	{
		long long numerator=min(a,b);
		long long denominator=max(a,b);
		long long remainder = a % b;
		while(remainder !=0)
		{
			 numerator   = denominator;
			denominator = remainder;
			remainder   = numerator % denominator;
		}
		long long gcd = denominator;
		long long lcm = a * (b / gcd);
		cout<<gcd<<" "<<lcm<<endl;
		/*
		for(long i=min(a,b);i>0;i--)
		{
			if(a%i ==0)
				if(b%i==0)
				{
					cout<<i<<" ";
					break;
				}
		}
		for(long i=max(a,b);i<=2000000000;i+=max(a,b))
		{
			if(i%a ==0)
				if(i%b==0)
				{
					cout<<i<<endl;
					break;
				}
		}*/
	}
}

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

typedef unsigned long long ull;


ull gcd(ull x, ull y){
  return y == 0 ? x : gcd(y,x % y);
}

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

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

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

int main()
{
    long long int a,b,n=0;
    while(cin >> a >> b){
        if (a>b) {
            n = b;
            while (a % b != 0) {
                b = a % b;
            }
            cout << b << " " << a*n/b << endl;
        }
        
        if (b>a) {
            n = a;
            while (b % a != 0) {
                a = b % a;
            }
            cout << a << " " << b*n/a << endl;
        }

    }
    
    
}

C++: #include <iostream>

using namespace std;

int main()
{
	
	int a, b, c = 0;
	while (cin >> a, cin >> b)
	{
		for (int i = 1; i <= a, i <= b; i++)
		{
			if (a % i == 0 && b % i == 0)
			{
				c = i;
			}
		}
		cout << c << " " << a*b / c << endl;
	}
	getchar();
	getchar();
	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(){
	while(true){
		int a,b;
		cin>a>>b;
		
		if(cin.eof())
			break;
			
		int g=gcd(a,b);
		cout<<g<<' '<<a/g*b<<endl;
	}
	return 0;
}

C++: #include <cstdio>

unsigned gcd(unsigned a, unsigned b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }
  while (a % b != 0) {
    unsigned t = a;
    a = b;
    b = t % b;
  }
  return b;
}

int main() {
  unsigned a, b;
  while (!feof(stdin)) {
    scanf("%d %d", &a, &b);
    unsigned d = gcd(a, b);
    unsigned m = a / d * b;
    printf("%d %d\n", d, m);
  }
  return 0;
}

C++: #include<stdio.h>
#include<string.h>

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

int LCM(int x,int y)
{
  return x * y / GCD(x,y);
}



int main(void)
{
  int a,b,k;
  while(scanf("%d %d",&a,&b) != EOF)
    {
      if(a<b){
	 k = b;
	b = a;
	a = k;
      }
      printf("%d %d\n",GCD(a,b),LCM(a,b));
    }
}