Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		row := strings.Fields(scanner.Text())
		nums := []int{}

		for _, v := range row {
			num, _ := strconv.Atoi(v)
			nums = append(nums, num)
		}
		fmt.Println(gcd(nums[0], nums[1]), lcm(nums[0], nums[1]))
	}
}

C++: #include <stdio.h>


using namespace std;

typedef long long ll;

int gcd(int x,int y) {
        return y > 0 ? gcd(y,x % y) : x;
}
int main() {

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

}

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

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

int main(){
	int a, b, min ,max, gcd, lcm;
	
	while(cin >> a >> b){
		
		min = min(a, b);
		max = max(a, b);
		
		for(int i = 0; i < min; i++){
			if(min % i == 0 && max % i == 0) gcd = i;
		}
		
		while(1){
			int i = 1;
			if( (max * i) % min == 0) {
				lcm = max *i;
				break;
			}
			else i++;
		}
	}	
		cout << gcd <<  " " << lcm << endl;
}

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

using namespace std;

int a, b;
int gcd, lcm;

void GCD(){

	int big, small;

	big = a;
	small = b;

	while (big) {
		if (small > big) swap(big, small);
		big = big % small;
	}
	gcd = small;

}

void LCM() {
	lcm = a * b / gcd;
}




int main(){
	while (cin >> a >> b) {

		GCD();
		LCM();
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007; 
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10;

template<class T, class S> inline bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S> inline bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}




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

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



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

C++: #include <iostream>
using namespace std;
int main()
{
	int a,b,r;
	while(cin>>a>>b)
	{
		int a1=a,b1=b;
		while(r=a%b)
		{
			a = b;
			b = r;
		}
		cout<<b<<" "<<a1/b*b1;        //先除再除?少数量? 
	}
	return 0;
}

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

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

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

C++: #include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;

ll gcd(ll a,ll b)
{
    if (!b) return a;
    else return gcd(b,a%b);
}

int main()
{
    ll a,b;
    while(cin>>a>>b)
    {
        ll gcd1=gcd(a,b);
        ll lcm1=a/gcd1*b;
        cout<<gcd1<<" "<<lcm1<<endl;
    }
}

C++: #include"iostream"
#include"iomanip"
#include"string"

using namespace std;

int gcd(int a, int b)
{
	int t;
	while (b!=0)
	{
		t = a;
		a = b;
		b = t%b;
	}
	return a;
}

int main()
{
	int a, b,GCD,t;
	while (cin >> a >> b)
	{
		GCD=gcd(a, b);
		cout << GCD << " " << a/GCD*b << endl;
	}
	return 0;
}

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

long long gcd(long long m, long long n){

	if(m<n){
		long long swap;
		swap = m;
		m = n;
		n = swap;
	}

	do {
		if(n==0){
			return m;
		}
		
		int swap = m % n;
		m = n;
		n = swap;
	} while(1);
}


int main(){
//	m*n = LCM * GCD
	long long m, n;
	while(cin >> m >> n){
		long long  LCM, GCD;
		
		GCD = gcd(m, n);
		LCM = (m*n)/GCD;
		cout << GCD << " " << LCM << endl;
	}

	return 0;
}

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

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

int main()
{
    long long a;
    long long b;
    while(scanf("%I64d%I64d",&a,&b)!=EOF)
    {
        printf("%I64d %I64d\n",gcd(a,b),a/gcd(a,b)*b);
    }
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;
int gcd(int x,int y)
{
	if(y==0)return x;
	return gcd(y,x%y);
}
int main()
{
    int a,b;
	while(cin >> a >> b){
		int z=gcd(a,b);
        int w=a/z*b;
		printf("%d %d\n",z,w);
	}
    return 0;
}

C++: // GCDandLCM.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;

double eucAlg(int a,int b);


int main(int argc, char* argv[])
{
	double a,b;	//??\??????
	double c, d;	//??????

	while(cin >> a >> b){

		c = eucAlg(a, b);

		d = a * b / c;
		cout << fixed << setprecision(0) << c << " " << d << endl;
	}
	return 0;
}

//??????????????????????????????
double eucAlg(
	int a,
	int b
	)
{
	double c;

	do
	{
		c = a % b;
		if(c == 0){
			break;
		}
		a = b;
		b = c;

	}while(1);

	return b;
}

C++: #include <iostream>
 
using namespace std;
 
int main(){
 
    unsigned long long a,b,c,d;
 
    while(cin>>a>>b){
        c=a;
        d=b;
        while(1){
            if(c>d)c=c-d;
            if(c<d)d=d-c;
            if(c==d){
                cout<<c<<" "<<a*b/c<<endl;
                ;break;}
        }}
         
 
 
return 0;
}

C++: #include <stdio.h>

template <typename T>
T gcd(T a, T b){
	T r;
	while(b > 0){
		r = a % b;
		a = b;
		b = r;
	}
	return a;
}
template <typename T>
inline T lcm(T a, T b){
	return a / gcd(a, b) * b;
}

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

	return 0;
}

C++: 




#define INF 1000000;
#define RE(i,n)  for(i=0;i<n;i++)
inline int max(int n1 = - 1000000 , int n2 = -1000000, int n3 = -1000000)
{
return n1 > n2 ? (n1 > n3 ? n1 : n3) : (n2 > n3 ? n2 : n3);
}
inline int min(int n1 = 1000000, int n2 = 1000000, int n3 = 1000000)
{
return n1 < n2 ? (n1 < n3 ? n1 : n3) : (n2 < n3 ? n2 : n3);
}
#include<iostream>
#include<time.h>
using namespace std;



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

}


//#define LOCAL
int main()
{
#ifdef LOCAL

	freopen("C:\\Users\\VULCAN\\Desktop\\data.in", "r", stdin);
	//	freopen("C:\\Users\\VULCAN\\Desktop\\data.out", "w", stdout);
#endif
//这是一条帅气的分界线，写程序从这里开始吧
	int a, b;
	while (cin >> a >> b)
	{
		
		int ans = gcd(max(a,b), min(a,b));
		cout << ans <<" "<< a  / ans*b << endl;
	}

//这是一条可爱的分界线
#ifdef LOCAL
printf("用时%.3f秒\n", (double)clock() / CLOCKS_PER_SEC);
#endif
return 0;
}