Go: package main
import (
	"os"
	"fmt"
	"strconv"
	"bufio"
	"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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
int main(){
    ll a, b;
    while(cin >> a >> b){
        cout << gcd(a, b) << " " << lcm(a, b) << "\n";
    }
}
/*⠀⠀⠀⠀⠀⢀⣀⣀⣀    
⠀⠀⠀⠰⡿⠿⠛⠛⠻⠿⣷
⠀⠀⠀⠀⠀⠀⣀⣄⡀⠀⠀⠀⠀⢀⣀⣀⣤⣄⣀⡀
⠀⠀⠀⠀⠀⢸⣿⣿⣷⠀⠀⠀⠀⠛⠛⣿⣿⣿⡛⠿⠷
⠀⠀⠀⠀⠀⠘⠿⠿⠋⠀⠀⠀⠀⠀⠀⣿⣿⣿⠇
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁

⠀⠀⠀⠀⣿⣷⣄⠀⢶⣶⣷⣶⣶⣤⣀
⠀⠀⠀⠀⣿⣿⣿⠀⠀⠀⠀⠀⠈⠙⠻⠗
⠀⠀⠀⣰⣿⣿⣿⠀⠀⠀⠀⢀⣀⣠⣤⣴⣶⡄
⠀⣠⣾⣿⣿⣿⣥⣶⣶⣿⣿⣿⣿⣿⠿⠿⠛⠃
⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄
⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡁
⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁
⠀⠀⠛⢿⣿⣿⣿⣿⣿⣿⡿⠟
⠀⠀⠀⠀⠀⠉⠉⠉
*/

//library//
ll mod_fact(ll a, ll mod){
    ll ans = 1;
    while(a > 1){
        ans = ans * a % mod;
        a--;
    }
    return ans; 
}
ll mod_pow(ll a, ll b, ll mod){
    ll ans = 1;
    while(b > 0){
        if(b & 1) ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans;
}
ll mod_inv(ll a, ll mod){
    return mod_pow(a, mod - 2, mod);
}
ll gcd(ll a, ll b){
    while(a % b){
        return gcd(b, a % b);
    }
    return b;
}
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

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

int main()
{
	long a,b;
	while(cin>>a>>b)
	{
		/*long numerator=min(a,b);
		long denominator=max(a,b);
		long remainder = a % b;
		while(remainder !=0)
		{
			 numerator   = denominator;
			denominator = remainder;
			remainder   = numerator % denominator;
		}
		long gcd = denominator;
		long long lcm = a * (b / gcd);
		cout<<gcd<<" "<<lcm<<endl;
		*/
		long long gcd=1;
		for(long long i=min(a,b);i>0;i--)
		{
			if(a%i ==0)
				if(b%i==0)
				{
					gcd=i;;
					break;
				}
		}
		cout<<gcd<<" "<<a * (b / gcd)<<endl;
	}
}

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

int main() {
	long long int a, b, t, aa, bb;

	while (1) {
		cin>>a;
		if (cin.eof()) break;
		cin>>b;

		aa = a;
		bb = b;

		while (1) {
			if (b==0) break;

			t = b;
			b = a % b;
			a = t;
		}
		cout<<a<<" "<<aa*bb/a<<endl;
	}
	return 0;
}

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


int main()
{
	long a[100],b[100];
	int i=0;
	while(cin >> a[i] >> b[i]){i++;}
	for(int j=0;j<i;j++){
		long c;
		long d=a[j],e=b[j];
		if (a[j]<b[j]){c=a[j];a[j]=b[j];b[j]=c;}
		while(a[j]%b[j]!=0){
			c=a[j];
			a[j]=b[j];
			b[j]=c%b[j];
		}
		cout << b[j] <<" " <<d/b[j]*e <<  endl;
	}
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<iomanip>

#define ll long long
#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

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

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


void solver() {
    ll a, b;
    while (cin >> a >> b) {
        cout << __algo_gcd(a, b) << " " << lcm(a, b) << endl;
    }
}

int main() {
    solver();
    return 0;
}

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

long long a,b;

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

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

C++: #include <iostream>

using namespace std;
typedef long long LL;

LL gcd(LL x, LL y){
  return (y == 0? x: gcd(y, x % y));
}

LL lcm(LL x, LL y){
  return x * y / gcd(x,y);
}

int main(){
  LL x, y;
  while(true){
	if(!(cin >> x >> y)) return 0;
	cout << gcd(x,y) << " " << lcm(x,y) << endl;
  }
  return 0;
}

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

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

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

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

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

C++: #include"iostream"
using namespace std;
int max(int a,int b)

{
	if(!b)
	{
		return a;
	}
	return max(b,a%b);
}
int main()
{
	int m,n,temp;
         while (scanf("%d%d", &m, &n) != EOF)
	{
		     
	    	
		 
			if(m>n)
			{
				int a=max(m,n) ;
			printf("%d %d\n",a,n/a*m);
			}
			else
			{
				temp=m;
				m=n;
				n=temp;
				int a=max(m,n);
			printf("%d %d\n",a,n/a*m);
				
			}
		 	
		}
	}

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

#define ULL_INT unsigned long long int

ULL_INT GCD(ULL_INT a, ULL_INT b) {
	if (a < b) swap(a, b);
	a = a % b; return (a == 0 ? b : GCD(a, b));
}

ULL_INT LCM(ULL_INT a, ULL_INT b) {
	return a * b / GCD(a, b);
}

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

C++: #include <stdio.h>

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