Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanLines)
	defer out.Flush()

	for sc.Scan() {
		a, b := nextInts()
		x, y := gcd(a, b), lcm(a, b)
		fmt.Fprintf(out, "%d %d\n", x, y)
	}

}

func nextInts() (a, b int) {
	s := strings.Split(sc.Text(), " ")
	ra, _ := strconv.Atoi(s[0])
	rb, _ := strconv.Atoi(s[1])
	a = ra
	b = rb
	return
}

func gcd(x, y int) int {
	if x < y {
		gcd(y, x)
	}
	for 0 < y {
		r := x % y
		x, y = y, r
	}
	return x
}

func lcm(x, y int) int {
	return (x * y) / gcd(x, y)
}

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

int gcd(int x, int y) { return y > 0 ? gcd(y, x % y) : x; }

int main(int argc, char const *argv[]) {
  int a, b, tmp;
  while (!(cin >> a >> b).eof()) {
    if (a < b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    std::cout << gcd(a, b) << ' ' << 1ll * a * b / gcd(a, b) << '\n';
  }
  return 0;
}

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


const int GCM(const int a,const int b){
	int x(a),y(b);
	while(x%=y){
		std::swap(x,y);
	}
	return y;
}

const int LCM(const int a,const int b){
	int x(a),y(b);
	while(x%=y){
		std::swap(x,y);
	}
	return a*b/y;
}


int main(int,char**){
	int a,b;
	while(std::cin >>a){
		std::cin >> b;
		std::cout << GCM(a,b) << ' ' << LCM(a,b)<<std::endl;
	}
	return 0;
}

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

using namespace std;

void swap(int& a, int& b){
	int tmp = a;
	a = b;
	b = tmp;
}

int main(void){
	int a,b;
	vector<int> gcd;
	vector<int> lcd;
	while (cin >> a >> b){
		if (a < b){
			swap(a,b);
		}
		int hiyosu = a;
		int yosu = b;
		int amari = -1;
		while (amari != 0){
			amari = hiyosu % yosu;
			hiyosu = yosu;
			yosu = amari;
		}
		gcd.push_back(hiyosu);
		lcd.push_back(a*(b/hiyosu));
	}
	for (unsigned int i=0; i<gcd.size(); ++i){
		cout << gcd[i] << " " << lcd[i] << endl;
	}
	return 0;
}

C++: #include<cstdio>
int g(int a,int b){return b?g(b,a%b):a;}
main(){int a,b,n;while(~scanf("%d%d",&a,&b))printf("%d %d\n",n=g(a,b),a/n*b);}

C++: #include <iostream>
using namespace std;
int a1,a2;
int gcd,lcm;

int GCD(int a,int b){
    int i = 2;
    int minimum = min(a,b);
    if (minimum == 0){
        i = 0;
    }
    else if (minimum == 1){
        i = 1;
    }
    else {
        for (i = 1; i <= minimum; i++) {
            if (a % (minimum - i + 1) == 0 & b % (minimum - i + 1) == 0) {
                i = minimum - i + 1;
                break;
            }
        }
    }
    return i;
}

int main(){
    while(cin >> a1 >> a2) {
        gcd = GCD(a1,a2);
        if (gcd == 0){
            lcm = 0;
        }
        else{
            lcm = a1*a2/gcd;
        }
        cout << gcd << " " << lcm << endl;
    }
}

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

int gcd(int a, int b) {
   int p,q,r;
   if(a<b){p=b;b=a;a=p;}
   while(r!=0){
       q=b/a;
       r=b%a;
       b=a;
       a=r;
   }
   return b;
}

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

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a,b,x,y,L;
while(cin>>a>>b){
x=a;y=b;
while(1){
  if(x==y){break;}
  else if(x==0)break;
  else if(y==0)break;
  else if(x<y){y=y-x;x=x-y;}
  else{x=x-y;y=y-x;}
}
(float)L=((float)a*(float)b)/(float)x;
cout<<y<<" ";printf("%f",L);cout<<endl;
}
  return 0;
}

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

int gcd(int a, int b)
{
    int i;
    if (b > a){
        int j = a;
        a = b;
        b = j;
    }
	for (i = a; i >= 1; i--){
		if (a % i == 0)
			if( b % i == 0)
				return i;
				break;
	}
}


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

C++: #include <iostream>

using namespace std;

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

int lcm(int a, int b) {
    return a * b / gcd(a, 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()
{
	
	int a, b, c = 0;
	while (cin >> a, cin >> b)
	{
		for (int i = 1; i <= a, i <= b; i++)
		{
			if (a % i == 0 && b % i == 0)
			{
				c = i;
			}
		}
		cout << c << " " << a*b / c << endl;
	}
	getchar();
	getchar();
	return 0;
}

C++: #include <stdio.h>
#define D(fmt,...) fprintf(stderr, fmt, ##__VA_ARGS__)
#define P(fmt,...) fprintf(stdout, fmt, ##__VA_ARGS__)

int gcd (int a, int b) {
  int min = a < b ? a : b;
  int gcd  = 1;
  int i = 0;
  for (i = 1; i < min; i++) {
    if (a % i == 0 && b % i == 0) {
      a /= i;
      b /= i;
      gcd *= i;
    }
  }
  return gcd;
}

int lcm (int a, int b, int g) {
  int lcm = 0;
  int min = a < b ? a : b;
  int x = a / g;
  int y = b / g;
  return g * x * y;
}
		      
int main (int ac, char **av)
{
  while(feof(stdin) == 0) {
    int a, b = 0;
    fscanf(stdin, "%d %d\n", &a, &b);
    int g = gcd(a, b);
    P("%d %d\n", g, lcm(a, b, g));
  }
  return 0;
}

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

int gcd(int a, int b) {
    int r;
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

int main(void){
   int a, b, tmp;
   if (a < b){
    tmp = b;
	b = a;
	a = tmp;

   }
   (cin >> a >> b);
     int lcm = b * a / gcd(a,b);
     cout << gcd(a,b) << " " << lcm << endl;
   
   return 0;
}

C++: #include <cstdio>
#include <cmath>
#define ele long
using namespace std;
ele a,b;
ele gcd(ele a,ele b){
	if (b==0) return a;
	return gcd(b,a%b);
}
inline ele lcm(ele a,ele b){ return a/gcd(a,b)*b; }
int main(){
	while (~scanf("%d%d",&a,&b)) printf("%d %d\n",gcd(a,b),lcm(a,b));
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

	unsigned long long a,b,c,d;

	while(cin>>a>>b){
		c=a;
		d=b;
		while(1){
			if(c>d)c=c-d;
			if(c<d)d=d-c;
			if(c==d){
				cout<<c<<" "<<a*b/c<<endl;
				;break;}
		}}
		


return 0;
}

C++: import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    c = a * b
    while b:
        a, b = b, a % b
    print(str(a) + ' ' + str(c / a))

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
 long int a, b, c, temp, min, A, B;
 while(cin >> a >> b){
  if(a == 0){
    cout << "0" << " " << "0" << endl;
  }
  else if(b == 0){
    cout << "0" << " " << "0" << endl;
  }
  else if(a < b){
    temp = a;
    a = b;
    b = temp;
  }

    
  else if (a > b){
    A = a;
    B = b;

    while(1){
      c = A % B;
      if(c == 0) break;
      else if(c != 0){
        A = B;
        B = c;
      }
    }
    min = (a / B) * b;
    cout << B << " " << min << endl;
  }
  else if(a == b){
    cout << a << " " << a << endl;
  }

 }
 return 0; 
}

C++: #include<iostream>
using namespace std;
int main(){
int a,b,g,x,y,L,i=0;
while(cin>>a>>b){
x=a;y=b;
while(1){
  if(x<y){y-x;}
  else if(x>y){x-y;}
  else if(x==y){g=x;break;}
}
L=(a*b)/g;
cout<<g<<" "<<L<<endl;
x=0;y=0;
  ++i;
  if(i==49){break;}
}
  return 0;
}

C++: #include "iostream"
#include "algorithm"
using namespace std;
int main(){
	long long a,b,c,d;
	while(cin>>a>>b){
		c = __gcd(a,b);
		d = (a/c)*b;
		cout << c << d << endl;
	}
}

C++: include <iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
int max=0,min;
for(int i=a;max=0;i--){
if(a%i==0 && b%i==0){
max=i;}}
min=(a/max)*b;
cout<<max<<" "<<min<<endl;
}
return 0;
}