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++: // 2012/11/07 Tazoe

#include <iostream>
using namespace std;

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

	return gcd(b, a%b);
}

int main()
{
	while(true){
		int a, b;
		cin >> a >> b;

		if(cin.eof())
			break;

		int g = gcd(a, b);
		cout << g << ' ' << a/g*b << endl;
	}

	return 0;
}

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

int GCD(int value1,int value2){
    int large,small;
    
    if(value1>=value2){
        large=value1;
        small=value2;
    }else{
        large=value2;
        small=value1;
    }
    
    if((large-small)==0){
        return large;
    }else{
        return GCD(small,large-small);
    }
}

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

C++: #include<stdio.h>
#include<stdlib.h>
#include<algorithm>


int yukurid(long long int, long long int);

int main()
{
	long long int a, b, tmp;
	while (scanf("%lld %lld", &a, &b) != EOF)
	{
		tmp = a;
		a = a < b ? b : a;
		b = tmp < b ? tmp : b;
		printf("%lld %lld\n", yukurid(a, b),((a*b)/yukurid(a,b)));
	}
	return 0;

}

int yukurid(long long int a, long long int b)
{
	long long int tmp;
	if (a%b == 0)return b;
	else
	{
		tmp = a;
		a = b;
		b = tmp%b;
		return yukurid(a, b);
	}
}

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

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

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

C++: #include <iostream>

using namespace std;

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

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

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int gcd(int a,int b)
{
	if(!b)
		return a;
	return gcd(b,a%b);
}
int main()
{
	int n,m;
	while(scanf("%d%d",&n,&m))
	{
		int tp=gcd(n,m);
		printf("%d %d\n",tp,n/tp*m);
	}
	return 0;
}

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

long gcd(long a, long b) {

    if ( a < b ) {
        long t = b;
        b = a;
        a = t;
    }

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

}

int main() {

    long a, b;
    
    while (cin >> a >> b) {

        long g = gcd(a, b);
        cout << g << " " << (a * b / g) << endl;
    }
     
    return 0;
}

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

int gcd(int a, int b){
  //a < b ユークリッドの互除法
  if(a==0) return b;
  return gcd(b%a,a);
}

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int a,b;
int gcd(int a,int b)
{
    if(b==0)
        return a;
    else
        return gcd(b,a%b);
}
int main()
{
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        int x=gcd(a,b);
        int y=a/x*b;
        printf("%d %d\n",x,y);
    }
}

C++: #include<iostream>

using namespace std;

int main(){
	int a,b,ta,tb,tc;
	while(1){
		cin >> a>>b;
		if(!a && !b)break;
		ta=a;
		tb=b;
		while(1){
			if(ta<tb){
				tc=ta;
				ta=tb;
				tb=tc;
			}
			tc=ta%tb;
			if(tc==0)break;
			ta=tb;
			tb=tc;
		}
		cout << tb<< " "<< a*b/tb <<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,b,c,x;
    cin >> a >> b;
    c=a*b;
    if(a>=b){
        x=a;
        a=b;
        b=x%b;
    }
    else if(a<b){
        b=a%b;
    }
    while(b!=0){
        x=a;
        a=b;
        b=x%b;
    }
    cout << a << " " << c/a << endl;
}

C++: #include<stdio.h>
int main(void){
  int a,b,i=1,ans1,ans2,ans3,j;
  
  while(scanf("%d %d",&a,&b)!=EOF){
    ans2=i*a;
    ans3=i*b;
      i=1;
      if(a>b){
      while(ans2!=ans3){
	ans2=i*a;
	for(j=i;ans2>ans3;j++){
	  ans3=b*j;  
	}
	i++;
      }
      printf("%d %d\n",a*b/ans3,ans3); 
      }
  

    else if(b>a){
      i=1;
      while(ans3!=ans2){
	ans3=i*b;
	for(j=i;ans3>ans2;j++){
	  ans2=a*j;  
	}
	i++;
      }
      printf("%d %d\n",a*b/ans2,ans2);
    }

    else{
      printf("%d %d\n",a,a);   
    }
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	int a,b,a1,b1,c;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		if(a<b)
		{
			a1=b;
			b1=a;
		}
		else
		{
			a1=a;
			b1=b;
		}
		while(1)
		{
			r=a1%b1;
			if(r==0)
				break;
			else
			{
				a1=b1;
				b1=r;
			}
		}
		cout<<r<<" "<<a*b/r<<endl;
	}	
	return 0;
}

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

using namespace std;

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

C++: #include <iostream>

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

int main()
{
    while (true) {
        int a, b;
        std::cin >> a >> b;
        if (std::cin.eof()) break;
        int g = gcd(a, b);
        std::cout << g << " " << a / g * b << std::endl;
    }
}

C++: #include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
int gcd(int a,int b)
{
   if(b==0) return a;
   return gcd(b,a%b);
}
int main()
{
    int x,y;
    while(scanf("%d %d",&x,&y)!=EOF)
      printf("%d %d\n",gcd(x,y),x/gcd(x,y)*y);
    return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
typedef long long bignum;
struct xy
{
	long long x;
	long long y;
};

int getGCD(int a, int b) {
	if (b != 0)
		return getGCD(b, a%b);
	else
		return a;
}
int main()
{
	int a, b;
	vector<xy> dst;
	while (cin >> a >> b ) {
		int GCD = a > b ? getGCD(a, b) : getGCD(b, a);
		bignum LCD = bignum(a) * bignum(b) / bignum(GCD);
		dst.push_back({ GCD ,LCD });
	}
	for (vector<xy>::iterator it = dst.begin(); it < dst.end(); it++)
		cout << (*it).x << " " << (*it).y << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int euclid(int a,int b) {
  if(a<b) {
    int tmp=a;
    a=b;
    b=tmp;
  }
  if(a%b==0) return b;
  return euclid(b,a%b);
}

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

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

using namespace std;

double a, b, c, d, e, f;


double x(double, double, double, double, double, double) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double, double, double, double, double, double) {

	return (a*f - c*d) / (a*e - b*d);
}

double round(double dat, int keta ){

	int fct;
	fct = (int)pow(10, keta - 1);
	dat *= fct;
	dat += (dat < 0) ? -0.5 : 0.5;
	dat = (int)dat;
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2;
	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

	cin >> a >> b >> c >> d >> e >> f;

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);

	cout << fixed << setprecision(3) << round(x1,4) << " " << round(y1,4) << endl;
	cout << fixed << setprecision(3) << round(x2,4) << " " << round(y2,4) << endl;

	return 0;
}