Go: package main

import "fmt"

func main() {
	var gcdArr, lcmArr [100]int
	var count int
	for {
		var x, y int
		fmt.Scanf("%d %d", &x, &y)
		if x == 0 {
			break
		}
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		gcdArr[count] = y
		lcmArr[count] = lcm / y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%d %d\n", gcdArr[i], lcmArr[i])
	}
}

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

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

using namespace std;
using ll = long long int;

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

    if(a < b)
        return gcd(b, a);
    else 
        return gcd(b, a%b);
}


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

C++: #include <cstdio>

using namespace std;

long long gcd(long long x, long long y)
{
    if (y == 0) return x;
    
    return gcd(y, x % y);
}

long long lcm(long long x, long long y)
{
    return x / gcd(x, y) * y;
}
 
int main() {
	long long a, b;
	
	while (scanf("%lld %lld", &a, &b) != EOF) {
	    printf("%lld %lld\n", gcd(a, b), lcm(a, b));
	}
	
	return 0;
}