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() {
		a, b := nextInts()
		x, y := gcd(a, b), lcm(a, b)
		fmt.Fprintf(out, "%d %d\n", x, 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
}

func gcd(x, y int) int {
	if x < y {
		gcd(y, x)
	}
	for 0 < y {
		r := x % y
		x, y = y, r
	}
	return x
}

func lcm(x, y int) int {
	return (x * y) / gcd(x, y)
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	int a,b,A,B;
	while(cin>>A>>B){
		a=A,b=B;

		if(a<b)swap(a,b);
		for(int r;(r=a%b)!=0;)a=b,b=r;

		int L=b,G=A*(B/L);
		cout<<L<<" "<<G<<endl;
	}
	return 0;
}

C++: #include<iostream>
int e(int a,int b){if(a<b)a^=b^=a^=b;return (a%=b)?e(b,a):b;}int f(int a,int b,int c,int d){if(a<b)a^=b^=a^=b;for(;a>b;)b+=d;return a-b?f(b,a,d,c):a;}int main(){for(int a,b,s;s=!(std::cin>>a>>b).eof();s&&printf("%d %d\n",e(a,b),f(a,b,a,b)));}

C++: #include <iostream>

using namespace std;

int dev(int*,int*,int);

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

	while(cin >> a){
		cin >> b;
		gcd=1;

		gcd*=dev(&a,&b,2);
		for(int i=3;i<(a<b?a:b);i+=2)
			gcd*=dev(&a,&b,i);

		cout << gcd << " " << a*b*gcd << endl;
	}

	return 0;
}

int dev(int *a,int *b,int n){
	int fac=1;
	
	while(*a%n==0&&*b%n==0){
		*a /= n;
		*b /= n;
		fac *= n;
	}

	return fac;
}

C++: #include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000009
#define EPS 1E-9

ll gcd(ll a, ll b)
{
  ll tmp;

  while(b){
    tmp = a;
    a = b;
    b = tmp%b;
  }

  return a;
}

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

ll a, b;

int main()
{
  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;
    cin>>a>>b;
    int a2=a;
    int b2=b;
    
    while(true) {
        if(a>b){
            a=a%b;
        }else{
            b=b%a;
        }
        if(a==0||b==0)break;
    }
    cout<<max(a,b)<<" "<<a2*b2/max(a,b)<<endl;
    return 0;
}

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

C++: // ------------------------------------                                                                  
// Date:2018/ 2/13                                                                                       
// Problem:0005 : GCD&LCM 5.cpp                                                                          
//                                                                                                       
// ------------------------------------                                                                  

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define REP(i,n) FOR(i,0,n)

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

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

u_int getGCD(u_int m, u_int n){
  u_int temp;
  if(m < n)
    std::swap(m,n);
  while(n != 0){
    temp = m % n;
    m = n;
    n = temp;
  }
  return m;
}

inline u_int getLCM(u_int m, u_int n, u_int gcd){
  return m * (n / gcd);
}

int main(){
  u_int a, b, gcd;
  while(std::cin >> a >> b){
    gcd = getGCD(a, b);
    std::cout << gcd << " " << getLCM(a, b, gcd) << std::endl;
  }
  return 0;
}

C++: #include <cstdio>

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

int lcm( int m, int n )
{
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); 
}

int main()
{
	int a,b;
	while(scanf("%d %d",&a,&b) != EOF)
	{
		int kari1,kari2;
		kari1=gcd(a,b);
		kari2=lcm(a,b);
		printf("%d %d\n",kari1,kari2);
	}
	return 0;
}

C++: #include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<iomanip>
#include<string>
using namespace std;

int gcd(long long int m,long long int n){
	while(m!=n){
		if(m>n){m=m-n;
		}
		else n=n-m;
	}
	return m;
}
int lmc(long long int m,long long int n){
return m*n/gcd(m,n);
}

int main(){
long long int a,b;
while(cin>>a>>b){
	cout<<gcd(a,b)<<" "<<lmc(a,b)<<endl;

}


}

C++: #include <iostream>

using namespace std;

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

int gcd(int x,int y)
{int r=1,m=1;
    while (r)
    {
        if(x>y)
        {r=x=x%y;m=y;}
    else
        {r=y=y%x;m=x;}
    }
    return m;
}
int lcm(int x,int y)
{int i=1;
    while (i>=1)
    {
    if (i%x==0&&i%y==0)
        break;
    else
        i++;
    }
    return i;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
//#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 28);
const ll LINF = 1e18;
const double PI = acos(-1);

ll gcd(ll x, ll y) {
	int r = 0;
	if (x < y) swap(x, y);

	while (y > 0) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

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


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a, b;
	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
	//PAU;
	return 0;
}