Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanLines)
	defer out.Flush()

	for sc.Scan() {
		x, y := nextInts()
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		fmt.Fprintf(out, "%d %d\n", y, lcm/y)
	}

}

func nextInts() (a, b int) {
	s := strings.Split(sc.Text(), " ")
	ra, _ := strconv.Atoi(s[0])
	rb, _ := strconv.Atoi(s[1])
	a = ra
	b = rb
	return
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int gcd(int a, int b){
    int p,q,r;

if(a < b) {
  return gcd(b, a);
}

    while(r!=0){
    q=b/a;
    r=b%a;
    b=a;
    a=r;
    }
    return b;
}

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

C++: #include<iostream>
using namespace std;
int main(void)
{
    int a,b,fl;
    while(cin>>a>>b)
    {
        fl=0;
        for(int i=a;fl==0;i--)
        {
            if(a%i==0&&b%i==0)
            {
                cout<<i<<" ";
                fl++;
            }
            else;
        }
        fl=0;
        for(int i=a;fl==0;i++)
        {
            if(a%i==0&&b%i==0)
            {
                cout<<i<<endl;
                fl++;
            }
            else;
        }
    }
    return 0;
}

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

int main(){
	int a,b,c;
	int ansG,ansL1,ansL2;
	while(cin>>a>>b){
		ansL1=a;ansL2=b;
		if(a<b){
			int hoge=a;
			a=b;
			b=hoge;
		}
		while(true){
			if(a%b==0){
				ansG=b;
				break;
			}
			else{
				c=a%b;
				a=b;
				b=c;
			}
		}
		ansL1=ansL1/ansG;
		ansL2=ansL2/ansG;
		cout<<ansG<<" "<<ansG*ansL1*ansL2<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
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>
using namespace std;

int gcd(int m,int n){
	if(m==0||n==0) return 0;
	while(m!=n){
		if(m>n) m=m-n;
		else n=n-m;
	}
	return m;
}

int main(void){
	int a,b;

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

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

int GCD(int a,int b){
    int r;
    while(b!=0){
        r=b;
        b=a%b;
        a=r;
        }
    return a;
}

int LCM(int a,int b){
    return a*b/GCD(a,b);
}
int main(){
    int a[100]={0};
    int b[100]={0};
    int i=0;
    while(cin>>a[i]>>b[i]){
  
        i++;
        }
    for(int j=0;j<i;j++)
        cout<<GCD(a[j],b[j])<<" "<<LCM(a[j],b[j])<<endl;
        
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

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

ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

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

C++: #include <iostream>

using namespace std;

int GCD(int a, int b)
{
	int gcd;
	while (a > 0 && b > 0)
	{
		if (a > b)
		{
			a %= b;
		}
		else
		{
			b %= a;
		}
	}
	if (a > 0)
	{
		gcd = a;
	}
	else
	{
		gcd = b;
	}
	return gcd;
}

int LCM(int a, int b)
{
	int init_a = a;
	int init_b = b;
	while (1)
	{
		while (a > b)
		{
			b += init_b;
		}
		if (a == b) break;
		a += init_a;
	}
	return a;
}

int main()
{
	int a, b;
	while (cin >> a >> b, !cin.eof())
	{
		cout <<	GCD(a, b) << " " << LCM(a, b) << endl;
	}
	return 0;
}

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

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

	return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define dump(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a, b;
  while(1) {
    if(!(cin >> a)) { break; }
    cin >> b;
    ll ans = 0;
    ll x = gcd(a, b);
    ll y = a / x * b;
    cout << x << ' ' << y << endl;
  }
  return 0;
}

C++: /*
 * fudq.cpp
 *
 *  Created on: 2015-10-24
 *      Author: bjfudq
 */
#include <functional>
#include <algorithm>
#include <iostream>
//#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;
//#pragma comment(linker,"/STACK:102400000,102400000")


#define MEM(a) (memset((a),0,sizeof(a)))
#define LEN(a) (int)strlen((a))
#define fr(a) for(int i=0;i<(a);i++)
#define sf(a) scanf("%d",&(a))
#define sf64(a) scanf("%I64d",&(a))
#define sff(a) scanf("%lf",&(a))
#define sfs(a) scanf("%s",(a))
#define sf2(a,b) scanf("%d%d",&(a),&(b))
#define sf3(a,b,c) scanf("%d%d%d",&(a),&(b),&(c))
#define sf2s(a,b) scanf("%s%s",(a),(b))
#define sf2f(a,b) scanf("%lf%lf",&(a),&(b))
#define sf3f(a,b,c) scanf("%lf%lf%lf",&(a),&(b),&(c))
#define sf264(a,b) scanf("%I64d%I64d",&(a),&(b))
#define sf364(a,b,c) scanf("%I64d%I64d%I64d",&(a),&(b),&(c))
#define pf(a) printf("%d\n",(a))
#define pfc(a) printf("%c",(a))
#define pf64(a) printf("%I64d\n",(a))
#define pff(a) printf("%lf\n",(a))
#define pfs(a) printf("%s\n",(a))
#define pf2(a,b) printf("%d %d\n",(a),(b))
#define pf2s(a,b) printf("%s%s\n",(a),(b));
#define pf2f(a,b) printf("%lf %lf\n",(a),(b))
#define pf264(a,b) printf("%I64d %I64d\n",(a),(b))
#define pfn printf("\n")
#define pfk printf(" ")
#define LL long long

const int N=1000010;
const int M=1000010;
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const int dir4[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
const int dir8[8][2]={{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1}};
const double eps=1e-12;
const double PI=acos(-1.0);

inline int sign(double x){return (x>eps)-(x<-eps);}
template<class T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T> inline T Min(T a,T b){return a<b?a:b;}
template<class T> inline T Max(T a,T b){return a>b?a:b;}
/*************************/



int main(){
    LL a,b;
    while(sf264(a,b)!=EOF){
    	LL g=gcd(a,b);
    	pf264(g,a/g*b);
    }
    return 0;
}

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

int main(){
	long long a,b,c,d,e;
	std::cin>>a>>b;
    d=a;
	e=b;	
	if(b > a){
	long long d;
	d = a;
	a = b;
	b = d;
	}
	while(b!=0){
		c = a % b;
		a = b;
		b = c;
	}
	std::cout<<a<<" "<<(d*e)/a;
}

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

int gcd( int a, int b )
{
    int temp;

    if( a < b ) { temp = a; a = b; b = temp; }
    if( b < 1 ) return -1;

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


int main(){
  int a,b;
  while(1){
    cin >> a >> b;
    if(cin.eof())
      break;
    int g=gcd(a,b);
    //printf("%d %d\n",g,a/g*b);
    cout << g << a/g*b << endl;
  }

  return 0;
}