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++: //AOJ0005
#include<iostream>
using namespace std;

long long gcd(int n,int m){
	if(m==0)return n;
	gcd(m,n%m);
}
int main(){
	long long  n,m;
	while(cin>>n>>m){
		cout<<gcd(n,m)<<" "<<n*m/gcd(n,m)<<endl;
	}
	return 0;
}

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

int main(){
    unsigned int a,b,c;
    int g,l,p;
    while(1){
        cin>>a>>b;
        p=a*b;
        while(b!=0){
            c=b;
            b=a%b;
            a=c;
        }
        g=a;
        l=p/g;
        cout<<g<<" "<<l<<endl;
    }
    return(0);
}

C++: #include<iostream>
int e(int a,int b){return(a%=b)?e(b,a):b;}int main(){for(int a,b,c,s;s=!(std::cin>>a>>b).eof();s&&printf("%d %d\n",c,a/c*b))c=e(a,b);}

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

template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class itr, class func> void array_output(itr start, itr goal, func out = [](itr x) { return x; } ){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class itr, class func> void nint_output(itr start, itr goal, func out = [](itr x) { return x; } ){ string ans; for(auto i = start; i != goal; i++){ ans += string(out(*i)) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcount(n)

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

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

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

    return gcd(b, a%b);
}

int main(){
    while(true){
        int a, b;
        cin >> a >> b;

        if(cin.eof())
            break;

        int g = gcd(a, b);

        cout << g << ' ' << a/g*b << endl;
    }
    
    return 0;
}

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

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

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

int main (int argc, char const* argv[])
{
    int a,b;
    while(cin >> a >> b){
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }
    return 0;
}

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

int LCM(int n, int m);

int main()
{
  int a, b, lcm;
  long long gcd;
  while (cin >> a >> b){
    if (a > b){
      int c = a;
      a = b;
      b = c;
    }
    lcm = LCM(a, b);
    gcd = a * b / lcm;

    cout << lcm << " " << gcd << endl;
  }
}

int LCM(int n, int m)
{
  if (n == 0){
    return (m);
  }
  m = m % n;
  return (LCM(m, n));
}

C++: #include <cmath>
#include <cstdlib>
#include <cstdio>

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

int main() {
  long a, b;
  long x, y;
  long gcd, lcm;

  while( std::cin >> a >> b ) {
    x = a;
    y = b;

    if( x < y ) std::swap(x, y);

    while( y != 0 ) {
      x %= y;
      std::swap(x, y);
    }

    gcd = x;
    lcm = (a / gcd) * b;

    std::cout << gcd << " " << lcm << std::endl;
  }  

  return 0;
}

C++: #include <iostream>

using namespace std;

int gcd(int, int);
int lcm(int, int);

int main(void){
	for(int a, b; cin >> a >> b; cout << gcd(a, b) << " " << lcm(a, b) << endl);

	return 0;
}

int gcd(int a, int b){
	if(a < b) swap(a, b);
	while(a = a % b){
		if(a < b) swap(a, b);
	}
	return b;
}

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

C++: #include <bits/stdc++.h>

typedef long long ll;

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

int main(){
    ll a,b;
    while(std::cin >> a >> b){
        ll c = gcd(a,b);
        std::cout << c << " " << a/c*b << std::endl;
    }
    return 0;
}

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

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

int main() {
	long a,b,G;
	while (cin>>a>>b){
	long c = 1;
	for (c = 1;c <= b ;c= c+1){
		if(a%c == 0 , b%c == 0){
			G = c;
		}
	}cout<<G<<" "<<a*b/G<<endl;
	}
}

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

using namespace std;

int main(void){

	int a,b,r;
	int tmp;
	double g,l;
	double tmpa,tmpb;

	while(cin>>a>>b){
		tmpa=a;
		tmpb=b;
		r=1;
		while(r){
			if(a<b){
				tmp=a;
				a=b;
				b=tmp;
			} 
			r=a%b; a=b; b=r;	
		}
		g=a;
		l=tmpa*tmpb/g;
		//cout.unsetf(ios::scientific);
		cout << fixed << setprecision(0) << g << ' ' << l << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <math.h>
#define eps 1e-9
using namespace std;
long long int gcd(long long int a,long long int b)
{
    return b?gcd(b,a%b):a;
}
int main()
{
    long long int x,y;
    while(cin >> x >> y)
    {
        cout << gcd(x,y) << " " << x*y/gcd(x,y) << endl;
    }
    return 0;
}

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

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

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

C++: #include<stdio.h>
int main(){
	int a,b,x,y;
	scanf("%d%d",&a,&b);
	x=a;
	y=b;
	while(a!=b){
		if(a>b){a-=b;}
		else {b-=a;}
	}
	printf("%d %d",a,x*y/a);
	return 0;
}

C++: 
int main(){
	int a,b;
	int gcd,lcm,hoge;
	while(cin >> a >> b){
		if (a > b) {
			hoge = a;
			a = b;
			b = hoge;
		}
		for (int i=1;i < a;i++){
			if (a%i==0 && b%i==0){
				gcd = i;
			}
		}
		for (int j=a;1;j++){
			if (j%a==0 && j%b==0){
				lcm = j;
				break;
			}
		}
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}

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