Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

//Min .
func Min(a, b int) int {
	switch a < b {
	case true:
		return a
	default:
		return b
	}
}

//GCDandLCM .
func GCDandLCM(i []int) (int, int) {
	a := i[0]
	b := i[1]

	for {
		if a == b {
			break
		} else {
			a, b = Min(a, b), int(math.Abs(float64(a-b)))
		}
	}

	return a, i[0] * i[1] / a
}

func main() {
	for sc.Scan() {
		i := Sliceconvtoi()
		g, l := GCDandLCM(i)
		fmt.Println(g, l)
	}

}

C++: /*------------------------------------------------------------------------------------------------|
| %%%%%%%%%%%%%%%%%%%%%%%%%MD.ASANURJAMAL ANOWAR HOSSAIN ANU%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| %%%%%%%%%%%%%%%%%%%%%%%%%COMPUTER SCIENCE AND ENGINEERING%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| %%%%%%%%%%%%%%%%%%%%%%%%%ISLAMIC UNIVERSITY KUSHTIA%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| %%%%%%%%%%%%%%%%%%%%%%%%%BANGLADESH%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|-------------------------------------------------------------------------------------------------*/
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <list>
#include <map>
#include <fstream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <bitset>
#include <cctype>
#include <vector>
#include <complex>
#include <ctime>
#include <deque>
#include <memory>
#include <utility>

#define S(a) scanf("%d",&a)
#define SL(a) scanf("%ld",&a)
#define S2(a,b) scanf("%d%d",&a,&b)
#define SL2(a,b) scanf("%ld%ld",&a,&b)
#define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define SL3(a,b,c) scanf("%ld%ld%ld",&a,&b,&c)
#define SLL(a) scanf("%lld",&a)
#define SLL2(a,b) scanf("%lld%lld",&a,&b)
#define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define SS(a) scanf("%s",a)
#define SC(a) scanf("%c",&a)
#define SD(a) scanf("%lf",&a)
#define P(a) printf("%d",a)
#define PL(a) printf("%ld",a)
#define PLL(a) printf("%lld",a)
#define PD(a) printf("%lf",a)
#define PC(a) printf("%c",a)
#define PS(a) printf("%s",a)
#define CS(kk) printf("Case %ld: ",kk++)
#define NL(kk) printf("\n")
#define PI 3.14159265358979323846264338327950
#define eps 1e-9
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)

using namespace std;

long long gcd(long long  a,long long b)
{
while(b>0)
{
a=a%b;
a=a^b;
b=b^a;
a=a^b;
}
return a;
}

long long lcm(long a,long long b)
{
    long long x=(a*b)/gcd(a,b);
    return x;
}
int main()
{
    long long i,ii,l,p,s,n,ll;
    long long a,b,c;
    //cin>>n;
    while(cin>>a>>b)
    {
     l=gcd(a,b);
     ll=lcm(a,b);
     cout<<l<<" "<<ll<<endl;
    }
 return 0;
}

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

using namespace std;

int calc_gcj(int a, int b) {
	int A=0, B=0;
	if (a == max(a,b)) {
		A = a;
		B = b;
	} else {
		A = b;
		B = a;
	}
	if (A == B) return A;
	else return calc_gcj(B,A-B);
	return -1;
}

void solve(int a, int b) {
	int gcj = calc_gcj(a,b);
	int lcm = a/gcj*b;
	cout << gcj << " " << lcm << endl;
}

int main() {
	int a, b;
	while (cin >> a >> b) {
		solve(a,b);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

int gcd(int a,int b){
  if(b==0)return a;
  return gcd(b,a%b);
}
int lcm(int c,int d){
  int e=gcd(c,d);
  return c/e*d;
}


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

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=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() {

    long ain,bin;
    long c,d,e,gcm,lcd;
    
    cin >> ain >> bin;
    if (ain < bin) {
        c = ain;
        ain = bin;
        bin = c;
        c=0;
    }

    c=ain;
    d=bin;

    for(;;) {
        if(d==0) {
            gcm = c;
            lcd = ain * bin / gcm;
            break;
        }
        e = c % d;
        c = d;
        d = e;
    }

    cout << gcm << " " << lcd << endl;


    return 0;
}

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

long gcd(long a, long b){
    if(a < b){
        swap(a, b);
    }else{
        while(b > 0){
            long r = a % b;
            a = b;
            b = r;
        }
    }
    return a;
}

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

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

C++: #include <iostream>

using namespace std;

using ll = long long;

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

int main() {
    ll x, y;
    while(cin >> x >> y) {
        ll g = gcd(x, y);
        cout << g << " " << x/g*y << endl;
    }
}

C++: #include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>

using namespace std;

typedef long long ll;

ll gcd(ll x, ll y){

    if(x<y) return gcd(y,x);
    if(y==0) return x;
    return gcd(y,x%y);

}

int main(){

    cin.sync_with_stdio(false);

    long long x,y;

    while(cin >> x >> y){

        long long m = gcd(x,y);

        cout << m << " " << x/m * y << endl;

    }

    return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  unsigned long long int a,b;
  while(cin>>a>>b)
  cout<<__gcd(a,b)<<" "<<(a*b)/__gcd(a,b)<<endl;
}

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

using namespace std;

typedef long long ll;

ll a, b;

ll gcd(ll a, ll b)
{
	if(!b)
		return a;
	if(a < b)
		return gcd(b, a);
	if(!(a&1) and !(b&1))
		return gcd(a>>1, b>>1)<<1;
	else if(!(a&1))
		return gcd(a>>1, b);
	else if(!(b&1))
		return gcd(a, b>>1);
	else
		return gcd(b, a-b);
}

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

int main()
{
	//freopen("in.txt", "r", stdin);
	while(true)
	{
		if(scanf("%lld", &a) == EOF || scanf("%lld", &b) == EOF)
			return 0;
		ll g = gcd(a, b);
		printf("%lld %lld\n", g, lcm(g));
	}
}