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>
using namespace std;

long int mygcd(long int a, long int b)
{
    if (b == 0) return a;
    if (a < b) return mygcd(b,a);
    return mygcd(a-b,b);
}

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

    while(cin >> a)
    {
        cin >> b;
        long int gcd = mygcd(a,b);
        long int lcm = a*b/gcd;

        cout << gcd << " " << lcm << endl;
    }
    return 0;
}

C++: #include <stdio.h>


int main(){

	unsigned long a=0, b=0,i=0,m=0,n=0,B=0;

	while(scanf("%d%d", &a, &b)!=EOF){

		if (a < b){
			i = a;
			a = b;
			b = i;
		}
		B = b;

		while (1){

			if (b == 0){
				printf("0 ");
				break;
			}

			n = a%b;
			if (n == 0){
				printf("%d ", b);
				break;
			}
			m = n;
			n = b%m;
			b = m;
		}
		if (b == 0){
			printf("%d\n", a);
		}
		else{

			m = a / b;/*/公倍数*/
			m = m*B;
			printf("%d\n", m);
		}
	}

	return 0;
}

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

int main()
{
    int a,b,c,d,tmp=0;
    
    while(cin >> a >> b){
        if (a<b) {
            swap(a,b);
        }
        c = a;
        d = b;
        
        while (b) {
            tmp = b;
            b = a % b;
            a = tmp;
        }
        
        cout << a << " " << c*d/a << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
long long a,b;
void yakusuu (int i,int j){
	while(i>=0){
	     while(i<j){
		       j=j-i;
	      }
	     while(j<i){
		       i=i-j;
	     }
         if(i==j){
		    cout<<i<<" " ;
		    break;
	     }
    }
}
void baisuu (int i,int j){
	for(int m=1;m<=20000000000;m++){
		if(m%i==0&&m%j==0){
			cout<<m<<endl;
			break;
		}
	}
}
int main(){
	while(cin>>a>>b){
	    yakusuu(a,b);
	    baisuu(a,b);
    }
	 
}

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005

#include <iostream>
using namespace std;
#define ll long long
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }


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

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long int ll;

long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }

int main(){
	int a,b;
	while(scanf("%d %d",&a,&b)!=EOF){
		cout << GCD(a,b) << " " << a/GCD(a,b)*b << endl;
	}
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int gcd(int x,int y){
  if(y>x){
    int t=x;
    x=y;
    y=t;
  }
  while(true){
    int t=y;
    y=x%y;
    x=t;
  
    if(y==0){return x;}
  }
}

int lcm(int x,int y){
  return (double)x/gcd(x,y)*y;//オーバーフロー防止

}


int main(){
  int n,m;
  while(cin>>n>>m){
    cout<<gcd(n,m)<<' '<<lcm(n,m)<<endl;
  }
}

C++: #include <stdio.h>
typedef long long ll;

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

int main(void) {
  ll a, b;
  while(scanf("%lld%lld", &a, &b) != EOF) {
    printf("%lld %lld\n", gcd(a, b), a / gcd(a, b) * b);
  }
  return 0;
}

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

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

int gcd(int a, int b) {
   int p,q,r;
   if(a<b){p=b;b=a;a=p;}
   while(r!=0){
       q=b/a;
       r=a%b;
       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 <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define sz size()
#define all(A)    A.begin(), A.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define f0(i,b)   for(int i=0;i<(b);i++)
#define f1(i,b)   for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(int i=(a);i!=(b);i+=(c))
#define mod 1000000007

#define forr(i,n)    for(i=0; i<n; i++)
#define whilee(i,t)  while(i!=t)
#define  sl(a)  scanf("%lld",&a)
#define  pl(a)  printf("%lld",a)

//for(auto it =A.begin(); it!=A.end(); it++)
//sort(A.begin(),A.end());
//binary_search(A.begin(),A.end(),x);
//reverse(A.begin(), A.end());
//cout << *max_element(A.begin(), A.end());
//cout << *min_element(A.begin(), A.end());
//count(A.begin(), A.end(), X); //counts the occurrences of X
//distance(A.begin(),A.end());  //distance between first to last element
//accumulate(A.begin(), A.end(), 0); //add
//next_permutation(A.begin(), A.end());
//prev_permutation(A.begin(), A.end());
//swap(S[0], T[0]);
//scanf("%d",&x);
//printf("%d\n",x);

//vector <int> A;
//deque <int> A;
//queue <int> A;
//stack <int> A;
//set <int> A;
//map <int,int> A;
//pair <int,int> A ;
//vector <pair <int,int>> A ;
//char ch;
//string S, T, U;
ll gcd(ll a, ll b)
{
    if (b == 0)
    {
        return a;
    }
    return gcd(b, a % b);
}


ll findGCD(ll x, ll y)
{
    ll result;

    result = gcd(x,y);
    return result;
}

ll findLCM(ll x, ll y)
{
    ll ans = x;

    ans = ( (x * y) / (gcd(x,y)) );

    return ans;
}

ll i, j, k, a, b, c, d, f, g, h, l, m, n, p, q, r, s, t, w, x, y, z, maxx=INT_MIN, minn=INT_MAX, ans=0, sum=0, cnt=0;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    while(cin>>x>>y)
    {
       cout<<findGCD(x,y)<<" "<<findLCM(x,y)<<endl;
    }
    return 0;
}

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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
    long long int a, b, r = 1;
    while (cin >> a >> b)
    {
        if (a < b)
        {
            long long int temp;
            temp = b;
            b = a;
            a = temp;
        }
        long long int tempa = a, tempb = b;
        r = b;
        b = a;
        while (r != 0)
        {
            a = b;
            b = r;
            r = a % b;
        }
        long long ans = tempa * tempb / b;
        cout << b << " " << ans << endl;
    }
    return 0;
}

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

long long int a,b,n,m;

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

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

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstdio>
#define EPS 10e-6
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;
typedef long long ll;
int a, b;

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(){
	while(cin >> a >> b){
		cout << gcd(a, b) << " " << (a/gcd(a,b))*b << endl;
	}
	
}