Go: package main

import "fmt"

func main() {
	for {
		var x, y int
		fmt.Scanf("%d %d", &x, &y)
		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.Printf("%d %d\n", y, lcm/y)
	}
}

C++: #include <stdio.h>


int main(){

	unsigned long a=0, b=0,i=0,m=0,n=0,B=0;

	while(scanf("%d%d", &a, &b)!=EOF){
		B = b;

		if (a < b){
			i = a;
			a = b;
			b = i;
		}

		while (1){

			if (b == 0){
				printf("0 ");
				break;
			}

			n = a%b;
			if (n == 0){
				printf("%d ", b);
				break;
			}
			m = n;
			n = b%m;
			b = m;
		}
		if (b == 0){
			printf("%d\n", a);
		}

		m = a / b;/*/公倍数*/
		m *= B;
		printf("%d\n",m); 
	}

	return 0;
}

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

long long gcd (long long a, long long b) {
  if(a < b) {
    int foo = a;
    a = b;
    b = foo;
  }

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

int main() {
  long long a ,b;

  while (scanf("%ld", &a) != EOF) {
    scanf("%ld", &b);
    long long g = gcd(a, b);
    printf("%ld %.3lf\n", g, a * b / g);

  }

  return 0;
}

C++: #include <stdio.h>

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

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


  return 0;
}

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

using namespace std;

typedef long long ll;

double xx(double r) {
  return r*r;
}

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

int main() {
  ll a, b;
  while ( scanf("%lld%lld", &a, &b) != EOF ) {
    ll g = gcd(a, b);
    ll l = a / g * b;
    cout << g << " " << l << endl;
  }
}

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;
     
     while(cin >> a >> b){
         int lcm = (a*b)/gcd(a,b);
         cout<<gcd(a,b)<<" "<<lcm<<endl;
     }
     return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
//辗转相除 
int gcd(int a, int b) {
	if(b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

int main()
{
	int a, b;
	while(cin >> a >> b) {
		
		int a1 = max(a, b);
		int b1 = min(a, b);
		int res1 = gcd(a, b);					//最大公约数 
		long long t = (long long)a * b;		//t可能会超int范围(没有尝试) 
		long long res2 = t / res1;			//最小公倍数 
		cout << res1 << " " << res2 << endl;
		
	}
	return 0;
}

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

int gcd(int a,int b)
{
	if(b==0) return a;
	return gcd(b,a%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 <stdio.h>
using namespace std;

int gcd(long num1,long num2) {
	if (num2 == 0) {
		return num1;
	}return gcd(num2, num1 % num2);
}

int lcm(long num1,long num2) {
	return num1 / gcd(num1, num2) * num2;
}

int main() {
	long a, b;
	while (~scanf("%d %d",&a,&b)) {
		printf("%d %d\n", gcd(a, b),lcm(a,b));
	}
}

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;
    }
}