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<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
long long gcd(long long a,long long b)
{
    if(b) return gcd(b,a%b);
    return a;
}
int main()
{
    long long a,b;
    while(scanf("%lld %lld",&a,&b)!=EOF)
    {
        long long ans=gcd(a,b);
        long long ans1=a*b/ans;
        printf("%lld %lld\n",ans,ans1);
    }
    return 0;
}

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

int g,l;
double a,b,d;

int main()
	{

	while( cin >> a >> b )
		{
			d = a*b;
			while( a != b)
				{
					if( a>b ){ a = a-b; }
					else if( b>a ){ b = b-a; }
				}
				g = (int)a;
				l =  (int)(d/g);
				cout << g <<" "<< l << endl;
		}
		return 0;
	}

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

int Gcd(int a,int b){
    int c,d;
    if(b>a){
        d=a;
        a=b;
        b=d;
    }
    while(b!=0){
        c=b;
        b=a%b;
        a=c;
    }
    return(a);
}

int main(){
    int m,n;
    //long p;
    int k;
    while(cin>>m>>n){
        //p=m*n;
        k=Gcd(m,n);
        cout<<k<<" "<<m/k*n<<endl;
    }
}

C++: #include <iostream>
int GCD(int a, int b) {
 while (b!=0) {
  int r = a%b;
  a = b;
  b = r;
 }
 return a;
}
int main() {
 int a,b;
 while (std::cin>>a>>b) {
  int gcd = GCD(a,b);
  int lcm = a*b/gcd;
  std::cout << gcd << ' ' << lcm << std::endl;
 }
 return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int a, b;

int main() {
	int gcd, lcm;

	a = -1;
	cin >> a >> b;

	while (a != -1) {
		int cpyA = a;
		int cpyB = b;

		if (a < b) {
			int tmp = a;
			a = b;
			b = tmp;
		}
		while (a % b != 0) {
			int tmp = a;
			a = b;
			b = tmp % b;
		}

		gcd = b;

		lcm = cpyA / gcd * cpyB;
		
		cout << gcd << " " << lcm << endl;

		a = -1;
		cin >> a >> b;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

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

int main(){
	int a, b, dmy, t, gcd, lcm;
	while( scanf("%d%d",&a,&b)!=EOF ){
		t=a*b;
		while(a!=b){
			while(a>b) a-=b;
			while(a<b) b-=a;
		}
		gcd=a;

		lcm=t/gcd;
		printf("%d %d\n",gcd, lcm);
	}
 return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,b,lcm=0,count=0;
    while(cin>>a>>b){
    for(int k=a;k>=1;k--){
        if(a%k==0&&b%k==0) {
            lcm=k;
            break;
        }
    }
    cout<<lcm<<" "<<a*b/lcm<<endl;
}
}

C++: #include<iostream>
using namespace std;
typedef unsigned long long ull;
ull a,b;
ull gcd(ull x,ull y){
return y==0?x:gcd(y,x%y);
}
int main(){
    cin>>a>>b;
    ull temp=gcd(a,b);
    ull sum=a/temp*b;
    cout<<temp<<" "<<sum<<endl;
}

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

int gcd(int m, int n);
int lcm(int m,int n);

int main()
{
	int a[50], b[50];
	int set = 0;
	while( cin >> a[set] >> b[set])
		set++;

	for(int i = 0; i < set; i++)
		cout << gcd(a[i], b[i]) << " " << lcm(a[i], b[i]) << endl;

	return 0;
}

int gcd(int m, int n)
{
	int t;
	if(m < n){
		t = m;
		m = n;
		n = t;
	}

	t = m % n;
	while(t != 0){
		m = n;
		n = t;
		t = m % n;
	}
	return n;
}

int lcm(int m, int n)
{
	return ((m / gcd(m, n)) * n);
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int gcd(int a, int b) {
          int p,q,r;

if(a < b) {
  return gcd(b, a);
}


       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<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
int a, b;

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

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

C++: #include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)#include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)#include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)#include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)#include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)#include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)#include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)#include <iostream>
using namespace std;
int main(){
  int a,a2,i=1,j=1,b,b2;
  cin>>a>>b;
  while(1){
    a2=a*i;
    b2=b*j;
    if(a2==b2)break; 
    else if(a2<b2)
      i++;
    else j++;
  }  
  if(a<b){
    for(i=2;i<a+1;i++)
      if(a%i==0 && b%i==0)break;
      cout<<i<<endl;
  }
  else {
      for(i=2;i<b+1;i++)
	if(a%i==0 && b%i==0)break;
      cout<<i<<endl;
  } 

  cout<<a2<<endl; 
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;

//最大公約数
LL gcd(LL n, LL m) {
	if (m == 0)return n;
	return gcd(m, n%m);
}

//最小公倍数
LL lcm(LL n, LL m) {
	LL g = gcd(n, m);
	return n / g * m;
}

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