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>
#include<string>
#include<string.h>
#include <math.h>
#include<iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace  std;


/*
//my header
#include "define.h"
#include "geometry.h"*/

#define MyAbs(a) ((a)>0?(a):-(a))
#define MyEqualDoule(a,b) (MyAbs(a-b)<1e-6)

#define foreach(i,n) for(i=0;i<n;++i)
#define foreachd(i,n) for(int i=0;i<n;++i)
#define printfInt1(n) printf("%d\n",n)
#define scanfInt1(n) scanf("%d",&n)
#define scanfInt2(a,b) scanf("%d%d", &a, &b)
#define scanfInt3(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define scanfFloat2(a,b) scanf("%f%f", &a,&b)


void init()
{
#ifdef _WIN32
	freopen("1.txt", "r", stdin);
#endif
}

void func();

int main()
{
	init();
	func();

	return 0;
}

int gcd(int a,int b)
{
	int t;
	while (b) {
		t = a % b;
		a = b;
		b = t;
	}
	return a;
}
int lcm(int a,int b)
{
	return a / gcd(a,b) * b;
}

void func()
{
	int a, b;
	while(~scanfInt2(a,b))
	{
		printf("%d %d\n", gcd(a,b), lcm(a,b));
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
long long a,b;
void yakusuu (int i,int j){
	int I=i;
	int J=j;
	while(i>=0){
	     while(i<j){
		       j=j-i;
	      }
	     while(j<i){
		       i=i-j;
	     }
         if(i==j){
		    cout<<i<<" " ;
		    break;
	     }
	 }
	     cout<<I/i*J<<endl;
}
int main(){
	while(cin>>a>>b){
	    yakusuu(a,b);
    }
	 
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	unsigned long long a, b;
	while (cin >> a >> b){
		unsigned long long gcd, lcm;
		unsigned long long c, d;
		c = max(a, b);
		d = min(a, b);
		while (true){
			if (c % d == 0) {
				break;
			}
			else{
				gcd = c%d;
				c = d;
				d = gcd;
			}
		}
		lcm = a*b / gcd;
		cout << gcd <<' '<< lcm << endl;
	}
}

C++: #include<stdio.h>
int main(void) {
	long long int a, b, minans = 0, maxans = 0;
	while (scanf("%lld %lld", &a, &b) != EOF)
	{
		for (long long int i = (b / 2); i > 0; i--)
		{
			if (a%i == 0 && b%i == 0) {
				maxans = i;
				break;
			}
		}
		for (long long int i = 1; i <= a; i++)
		{
			if ((i*b) % a == 0) {
				minans = i*b;
				break;
			}
		}
		printf("%lld %lld\n", maxans, minans);
	}
	return 0;
}

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

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

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

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

C++:  #include <stdio.h>

 int n,m,ans,amari,ahokusa;

 int main()
 {
     scanf("%d%d",&n,&m);
     ans  = n*m;
     if(n < m)
     {
         ahokusa = n;
         n = m;
         m = ahokusa;
     }
     amari = n % m;
     while(amari != 0)
     {
        n = m;
        m = amari;
        amari = n % m;
     }
     ans = ans / m;

     printf("%d %d\n",m,ans);
     return 0;

 }

C++: /*
 * fudq.cpp
 *
 *  Created on: 2015-10-24
 *      Author: bjfudq
 */
#include <functional>
#include <algorithm>
#include <iostream>
//#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;
//#pragma comment(linker,"/STACK:102400000,102400000")


#define MEM(a) (memset((a),0,sizeof(a)))
#define LEN(a) (int)strlen((a))
#define fr(a) for(int i=0;i<(a);i++)
#define sf(a) scanf("%d",&(a))
#define sf64(a) scanf("%I64d",&(a))
#define sff(a) scanf("%lf",&(a))
#define sfs(a) scanf("%s",(a))
#define sf2(a,b) scanf("%d%d",&(a),&(b))
#define sf3(a,b,c) scanf("%d%d%d",&(a),&(b),&(c))
#define sf2s(a,b) scanf("%s%s",(a),(b))
#define sf2f(a,b) scanf("%lf%lf",&(a),&(b))
#define sf3f(a,b,c) scanf("%lf%lf%lf",&(a),&(b),&(c))
#define sf264(a,b) scanf("%I64d%I64d",&(a),&(b))
#define sf364(a,b,c) scanf("%I64d%I64d%I64d",&(a),&(b),&(c))
#define pf(a) printf("%d\n",(a))
#define pfc(a) printf("%c",(a))
#define pf64(a) printf("%I64d\n",(a))
#define pff(a) printf("%lf\n",(a))
#define pfs(a) printf("%s\n",(a))
#define pf2(a,b) printf("%d %d\n",(a),(b))
#define pf2s(a,b) printf("%s%s\n",(a),(b));
#define pf2f(a,b) printf("%lf %lf\n",(a),(b))
#define pf264(a,b) printf("%I64d %I64d\n",(a),(b))
#define pfn printf("\n")
#define pfk printf(" ")
#define LL long long

const int N=1000010;
const int M=1000010;
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const int dir4[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
const int dir8[8][2]={{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1}};
const double eps=1e-12;
const double PI=acos(-1.0);

inline int sign(double x){return (x>eps)-(x<-eps);}
template<class T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T> inline T Min(T a,T b){return a<b?a:b;}
template<class T> inline T Max(T a,T b){return a>b?a:b;}
/*************************/


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

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

int main(){
     long a,b,x,y,t,n;
    long  gcd,r;
    long l;
    while (scanf("%lld %lld",&x,&y)!=EOF){
    if(x>y){
        a = x;
        b = y;
    }
    else{
        a = y;
        b = x;
    }

      if(a==0) gcd = b;
      else if(b==0) gcd = b;


        while(b!=0){
          t = b;
          r = a %  b;
          b = r;
          a = b;







        }
        gcd = a;



    l = (x * y)/gcd;
    printf("%lld %lld",gcd,l);
    }

    return 0;


}

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

using namespace std;

int gcd(int,int);

int main()
{
	int a,b,GCD,LCM;

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

		LCM = (a*b) / GCD;

		printf("%d %d\n",GCD,LCM);
	}

	return 0;
}

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

C++: #include <iostream>

using namespace std;
unsigned gcd(unsigned a,unsigned b);
unsigned lcm(unsigned a,unsigned b);
int main(){
  unsigned a,b;

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

unsigned gcd(unsigned a,unsigned b){

  while(a%b){
    a^=b;
    b^=a;
    a^=b;
    b=b%a;
  }
  return b;
}
unsigned lcm(unsigned a,unsigned b){
  return a/gcd(a,b)*b;
}

C++: #include <iostream>

int get_GCD(u_int a, u_int b)
{
    while(a != 0 && b != 0){
        if(a >= b)
            a %= b;
        else
            b %= a;
    }
    return a != 0 ? a : b ;
}

int get_LCM(const u_int a, const u_int b, const u_int GCD)
{
    int LCM = a / GCD;
    return b * LCM;
}

int main()
{
    u_int a, b, GCD;
    while(std::cin >> a >> b){
            GCD = get_GCD(a, b);
            std::cout << GCD << " " << get_LCM(a, b, GCD) << std::endl;
    }    

    return 0;
}