Go: package main

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

func getInputAsInt(in string) (int, int) {
	inArr := strings.Split(in, " ")
	// Atoi(s string) (i int, err error) のerrは捨てる
	val1, _ := strconv.Atoi(inArr[0])
	val2, _ := strconv.Atoi(inArr[1])
	return val1, val2
}

func euclidean(val1, val2 int) (int) {
	surp := 1
	for  {
		surp = val1 % val2
		if surp != 0 {
			val1 = val2
			val2 = surp
		} else {
			break
		}
	}
	return val2
}

func calcLCM(val1, val2, gcd int) (int) {
	return val1/gcd*val2
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	
	for scanner.Scan() {
		val1, val2 := getInputAsInt(scanner.Text())
		gcd := euclidean(val1, val2)
		lcm := calcLCM(val1, val2, gcd)
		fmt.Println(gcd, lcm)
	}
}

C++: #include <iostream>
using namespace std;
#define ll long long
ll gcd(ll a, ll b){
	return b == 0 ? a : gcd(b, a%b);
}
ll lcm(ll a, ll b){
	return a*b / gcd(a, b);
}
int main()
{
	ll a, b;
	while (cin >> a >> b){
		cout << gcd(a, b) << " " << lcm(a, b) << "\n";
	}
	return 0;
}

C++: #include <cstdio>

using namespace std;

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

int main(){
    int a, b,gcd,lcm;
    while(true){
        scanf("%d%d",&a,&b);
        gcd = gcdr(a,b);
        //printf("%d\n",gcd);
        lcm = gcd * a / gcd * b / gcd;
        printf("%d %d\n",gcd,lcm);
    }
    
    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(){
	int a;
	int b;
	while(cin>>a>>b){
		cout<<gcd(a,b)<<" "<<a*b/gcd(a,b);		
	}

}

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

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
#include <ctype.h>
using namespace std;
int n,p,q=2,nn,pp;
long long lcm=1;
int main(){
	while(cin>>n>>p){
		nn=n;pp=p;
		while(1){
			if(n%q==0&&p%q==0){
			n/=q;p/=q;lcm*=q;q=2;}else{
			q++;}
			if(q>n&&q>p){
			break;}

		}
			cout<<lcm<<" "<<nn/lcm*pp<<endl;
			q=2;lcm=1;
	}
    return 0;}

C++: #include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
#include<queue>
#include<set>
#include<map>

using namespace std;

#define ll long long
#define inf  1e15+7
#define MAXN 110
#define exp 1e-4

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

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

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,r,G,R,L,tmp;
  while(cin >> a >> b){
    R = a; L = b;
    if(b > a){
      tmp = a; a = b; b = tmp;
    }
    while(1){
      r = a % b;
      if(r == 0)
        break;
      a = b;
      b = r;
       }
    G = b;
    R = R / G;
    L = L / G;
    cout << G <<" "<< R*L*G << endl;
  }
}

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

typedef long long ll;
ll gcd(ll a, ll b){
	return !b ? a : gcd(b, a % b); 
}

int main(){
	ios::sync_with_stdio(false);
	ll x, y;
	while(cin >> x >> y) cout<<gcd(x,y)<<" "<<x*y/gcd(x,y)<<"\n";
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;

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

int main(){
    long long A,B;
	while(cin>>A>>B){
		printf("%lld %lld\n",gcd(A,B),A*B/gcd(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 o(a) cout<<a<<endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

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

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

signed main(){
	int a,b;
	while(cin>>a>>b){
		o(gcd(a,b)<<" "<<lcm(a,b));
	}
}

C++: #include<iostream>
using namesapce 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;
}
return 0;
}

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

int main(){
	int x[2], k = 1, a, b;
	
	while(cin >>x[1]>>x[2]){
		if(x[2] > x[1]) swap(x[1], x[2]);
		a = x[1];
		b = x[2];
		while(x[3 - k] != 0){
			x[k] = x[k] % x[3 - k];
			k = 3 - k;
		}
		cout <<x[k]<<" "<<a / x[k] * b<<endl;
		k = 1;
	}
	
	return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	ll a,b;
	while(cin >> a >> b){
		ll gcd = __gcd((int)a,(int)b);
		ll lcm = a/gcd*b;

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

C++: #include<stdio.h>
int main()
{
    long long int a, b, remainder, num1, num2;
    while (scanf("%lld %lld", &num1, &num2) != EOF)
    {
        if(num1 > num2)
        {
            a = num1;
            b = num2;
        }
        else
        {
            a = num2;
            b = num1;
        }
        remainder = a % b;
    while(remainder != 0)
    {
        a = b;
        b = remainder;
        remainder = a % b;
    }
    printf("%lld %lld\n", b, (num1 * num2)/b);
    }
    return 0;
}

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

typedef long long LL;
typedef long double LD;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define min_3(a,b,c) min(a,min(b,c))
#define max_3(a,b,c) max(a,max(b,c))
#define mp1(a,b,c) P1(a,P(b,c))
#define pque(a) priority_queue<a>
#define rpque(a) priority_queue<a,vector<a>,greater<a>>

const int INF=1000000000;
const int dre_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dre_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};
const int kaijou[10]={1,1,2,6,24,120,720,5040,40320,362880};

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

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

C++: #include <string>
#include <vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>

using namespace std;


    long long g(long long a,long long b){

	int r=max(a,b)%min(a,b);
	if(r==0)  return min(a,b);
	else return g(min(a,b),r);
}

int main(){

	long long a,b;

	while(1){

	cin >> a >> b;

	if(cin.fail()) break;

	cout << g(a,b) << " " << (a*b)/g(a,b) << endl;

	}

	return 0;
}