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>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

//?????§??¬?´???°(????????????????????????????????????)
template<class T>T GCD(T a, T b);

//????°???¬?????°(ab == (GCD)(LCM) ??????)
template<class T>T LCM(T a, T b);


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


template<class T>T GCD(T a, T b)
{
	T ans;
	do
	{
		if( a == b )
		{
			ans = a;
			break;
		}
		
		if( a < b )swap(a, b);
		a -= b;
		
	}while( 1 );
	
	return ans;
}

template<class T>T LCM(T a, T b)
{
	return a * b / GCD(a, b);
}

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


int main(){

	int a, b;

	while(cin >> a >> b){

		long m = ( a>=b ? a : b );
		long n = ( a>=b ? b : a );

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

		cout << m << " " << a / m * b  << endl;

	}

	return 0;
}

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


const int GCM(const int a,const int b){
	int x(a),y(b);
	while(x%=y){
		std::swap(x,y);
	}
	return y;
}

const int LCM(const int a,const int b){
	int x(a),y(b);
	while(x%=y){
		std::swap(x,y);
	}
	long long tmp(a);
	tmp*=b;
	tmp/=y;
	return tmp;
}


int main(int,char**){
	int a,b;
	while(std::cin >>a){
		std::cin >> b;
		std::cout << GCM(a,b) << ' ' << LCM(a,b)<<std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int gcd (int a, int b) {
	for (;;) {
		if (!(a %= b)) return b;
		if (!(b %= a)) return a;
	}
}
int main () {
	int a, b, n, m;
	while (cin >> a >> b) {
		m = (n = gcd (a, b)) ? a/n*b : 0;
		cout << n << " " << m << endl;
	}
}

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

int u(int a, int b);
int l(int a, int b);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    //gcd = u(a, b);
  / lcm = l(a, b);
//printf("%d %d\n",gcd, lcm);
    //std::cout << gcd << " " << lcm << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(a==1 || b==1){
    if(a>=b){
      a = a % b;
    }else{
      b = b % a;
    }
  }
  
  if(a==1){return b;}
  else{return a;}
}

int l(int a, int b){
  int i = 2;
  
  while(1){
    if(a%i==0){
      if(b%i==0){return i;}
      else{i++;}
    }else{
      i++;
    }
  }
}

C++: #include<cstdio>
int g(int x,int y){
	if(y==0)return x;
	return g(y,x%y);
}

int main(){
	int a,b;
	while(~scanf("%d%d",&a,&b))printf("%d %d\n",g(a,b),a/g(a,b)*b);
}

C++: #include<iostream>
using namespace std;
int gcd(int a,int b) {
  if(a<b) {
    int tmp=a;
    a=b;
    b=tmp;
  }
  if(a%b==0) return b;
  return gcd(b,a%b);
}

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

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

long gongyueshu(long a,long b);
int  main()
{
	long  a,b,c,d;
	 while(scanf("%d %d",&a,&b)!=EOF)
	 

	{
	

	c=gongyueshu(a,b);
	d=a/c*b;
	
	cout<<c<<" "<<d<<endl;

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

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

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

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

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

int main(){
	int a,b;
	int i=1;
	int j=1;
	while(cin>>a>>b){
		while(1){
		if(a%i!=0){
			i++;
			continue;
		}
		if(b%j!=0){
			j++;
			continue;
		}
		if(a/i<b/j){
			j++;
			continue;
		}
		if(a/i>b/j){
			i++;
			continue;
		}
		if(a/i==b/j){
		cout<<a/i<<" ";
		break;
		}
	}
	
	i=1;
	j=1;
	while(1){
	if(a*i<b*j){
		i++;
		continue;
	}
	if(a*i>b*j){
		j++;
		continue;
	}
	if(a*i==b*j){
		cout<<a*i<<endl;
		break;
	}
	}
	}
return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int a, b, c, r;
	int gcd, lcm;
	int x, y;

	while (cin >> a >> b){
		x = a;
		y = b;
		if (b > a){
			c = a;
			a = b;
			b = c;
		}

		while(1){
			r = a % b;
			if (r == 0){
				break;
			}
			a = b;
			b = r;
		}
		gcd = b;
		x /= gcd;
		y /= gcd;

		cout << gcd << " " << x * y * gcd << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

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

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

int gcd(int a,int b){
    return b?gcd(b,a%b):a;
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}

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

    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

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

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

C++: #include<bits/stdc++.h>
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 lcm(int m,int n){
  if((m==0)||(n==0)) return 0;
  return ((m/gcd(m,n))*n);
}
int main(){
  int n,m;
  while(cin>>n>>m){
    cout<<gcd(n,m)<<" ";
    cout<<lcm(n,m)<<endl;
  }
return(0);
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){
    ll a,b;
    while(cin>>a){
        cin>>b;
        if(b>a)swap(b,a);
        ll aa=a,bb=b;
        ll o,p,q;
        while(bb!=0){
            o=bb;
            p=aa%bb;
            aa=bb;bb=p;
        }
        ll i=1;
        while(true){
            i++;
            ll ao=a*i;
            if(ao%b==0){
                q=ao;
                break;
            }
        }
        cout<<o<<" "<<q<<endl;
    }
   
    
    
    
return 0;
}

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

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

int main(void){
    int a, b, tmp;
    if (a < b){
        tmp = b;
b = a;
a = tmp;

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