Go: package main

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

func getInputAsInt(in string) (int, int) {
	inArr := strings.Split(in, " ")
	// Atoi(s string) (i int, err error) のerrは捨てる
	val1, _ := strconv.Atoi(inArr[0])
	val2, _ := strconv.Atoi(inArr[1])
	return val1, val2
}

func euclidean(val1, val2 int) (int) {
	surp := 1
	for  {
		surp = val1 % val2
		if surp != 0 {
			val1 = val2
			val2 = surp
		} else {
			break
		}
	}
	return val2
}

func calcLCM(val1, val2, gcd int) (int) {
	return val1/gcd*val2
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	
	for scanner.Scan() {
		val1, val2 := getInputAsInt(scanner.Text())
		gcd := euclidean(val1, val2)
		lcm := calcLCM(val1, val2, gcd)
		fmt.Println(gcd, lcm)
	}
}

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

int main(){
long long   a,b,ta,tb;
	
	while(cin>>a>>b){
	ta=a;tb=b;
	if(a<b)swap(a,b);
	while(true){
		long long tmp=a;
		a=b;
		b=tmp-b;
		if(a<b){
		b=1;
		break;
		}
		if(a-b==0)break;
	}
	cout<<b<<" "<<ta*tb/b<<endl;
	}
	return 0;
}

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

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

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

C++: #include<iostream>
#include<cstdio>
#include<utility>
using namespace std;
int main()
{
  long long int n=0,m=0;
  long long int i=0,j=0,l=0;

  while(scanf("%d %d",&n,&m) != EOF)
    {
      i = n;
      j = m;

      //koyaku
      if((n >= m) != true)swap(n,m);
      while(1)
	{
	  int amari = n % m;
	  n = m;
	  m = amari;
	  if(amari == 0) break;
	}
      
      //kobai
      l = i*j/n;
      
      cout << n << " " << l << endl;
    }
}

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 <iostream>
using namespace std;

int main(void){
    long long a,x,b,r,m;
    
    while(cin >> a >> b){
      if(a < b){
      x = b;
      b = a;
      a = x;
      }
    }
    
    for(long long i = 1; i < 2000000000; i++){
        if(i/a == i/b && i%a ==0 && i%b == 0){
          m = i;
          break;
        } 
    }
      
    for(int l = 0; b != 0; l++){
      r = a%b;
      a = b;
      b = r;
    }
    
    cout << a << " " << m << endl;

    return 0;
}

C++: #include <iostream>

int  main() {
	//?????§??¬?´???° =????????????????????????????????????
	/*(1) a ??? b ??§???????????????????????? r ?????\????????????
	???(2) r ??? 0 ?????? b ????????§??¬?´???°??§?????????????????????????????????
	???(3) ????????§????????¨????????°a = b?????°b = r ??¨?????? (1) ???????????????????????????*/

	 //????°???¬?????° =???a*b???/???a??¨b????????§??¬?´???°?????§?±?????????????
	long long  a = 0, b = 0, ad = 0, bd = 0, amari = 0, koba = 0;
	std::cin >> a >> b;
	ad = a; bd = b;
	
	a:
		amari = a%b;
		if (amari == 0) {
			std::cout <<  b <<" "<< ad*bd / b << std::endl;
		}
		else {
			a = b;
			b = amari;
			goto a;
		}
}

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

int max(int a, int b){
    int c;
    
    if(a == 0 || b == 0){
        return 0;
    }
    
    while(a != b){
        if(a > b){
            a = a - b;
        }else{
            b = b - a;
        }
    }
    
    return a;
}

int min(int a, int b){
    int d;
    
    if(a == 0 || b == 0){
        return 0;
    }
    
    d = a * b / max(a, b);
    
    return d;
}

int main()
{
    int a, b;
    
    while(cin >> a >> b){
        cout << max(a, b) << " " << min(a, b) << endl;
    } 
    
    return 0;
}

C++: #include <iostream>

using namespace std ;

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

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

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

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


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




  return 0;
}

C++: #include <iostream>

using namespace std;

int max(int a, int b)
{
	return a > b ? a : b;
}

int min(int a, int b)
{
	return a < b ? a : b;
}

int GCD(int a, int b)
{
	if (a == b)
	{
		return a;
	}
	else
	{
		return GCD(max(a, b) - min(a, b), min(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 <string>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <iomanip>


using namespace std;


int main(void) {
	int a, b;
	cin >> a >> b;
	int gcd = 1, lcm = a * b;
	if(a < b){
		a ^= b;
		b ^= a;
		a ^= b;
	}
	for(int i = 1;;i++){
		if(a * i % b == 0){
			lcm = a * i;
			break;
		}
	}
	for(int i = 2; i <= b; i++){
		if(a % i == 0 && b % i == 0){
			gcd *= i;
			a /= i;
			b /= i;
		}
	}
	
	cout << gcd << " " << lcm << endl;
}

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

C++: #include<iostream>
#define nijuoku 2000000000

using namespace std;

long long int saidaikouyaku(long long int a, long long int b){
    long long int big    = max(a,b);
    long long int little = min(a,b);
    long long int midori = big % little;
    
    while(true){
        if(midori == 0)return little;
        big    = little;        
        little = midori;
        midori = big % little;
    }
    return -1;
}

long long int saisyoukoubai(long long int a, long long int b){
    
    long long int big    = max(a,b);
    long long int little = min(a,b);
    
    for(long long int i = big; i < nijuoku; i += big){
        if(i % little == 0)return i;        
    }
    return -1;
};

            
int main(){

    long long int a, b;
    
    while(cin >> a >> b){
        cout << saidaikouyaku(a,b) << ' ' << saisyoukoubai(a,b) << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
int main()

{
    long long a,b,g,l,m,n,t;

    while(scanf("%lld%lld,&a,&b")!=EOF);
    {
        m=a;
        n=b;

        if(a==0) g=b;

        else if(b==0)
            g=b;

        else
        
            {
                while(n!=0)
            }
        }

  return 0;
 }
}

C++: #include <iostream>

int main(){

	u_int a, b;

	while(std::cin >> a >> b){

		u_int minmul; //least common multiple
		u_int maxdivi = 1; //greatest common divisor
		u_int small;

		if(a > b)
			small = b;
		else
			small = a;

		for(int i = 2; i <= small; ++i){
			if(a % i == 0  &&  b % i == 0){
				maxdivi = maxdivi * i;
				i = 2;
			}
		}
		minmul = a * b / maxdivi;

	std::cout << maxdivi << " " << minmul << std::endl;

	}

	return 0;
}

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

using namespace std;

int gcd(int a, int b) {
	return a % b ? gcd(b, a % b) : 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;
	}
}

C++: #include<iostream>

using namespace std;

int main(){
	int a,b,c,d;
	cin >> a >> c;
	b=a; d=c;
	while(b!=d){
		if(d<b){d+=c;}
		else b+=a;
			}
	cout << b << \n;
}