Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

//Min .
func Min(a, b int) int {
	switch a < b {
	case true:
		return a
	default:
		return b
	}
}

//GCDandLCM .
func GCDandLCM(i []int) (int, int) {
	a := i[0]
	b := i[1]

	for {
		if a == b {
			break
		} else {
			a, b = Min(a, b), int(math.Abs(float64(a-b)))
		}
	}

	return a, i[0] * i[1] / a
}

func main() {
	for sc.Scan() {
		i := Sliceconvtoi()
		g, l := GCDandLCM(i)
		fmt.Println(g, l)
	}

}

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