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])
	}
}

Python: try:
    GCD = 0
    LCM = 0
    while True:
        lists = list(map(int, input().split()))
        l = sorted(lists)
        num = l[0] * l[1]
        while l[0] < l[1]:
            GCD = l[1] - l[0]
            l[1] = GCD
            l = sorted(l)
            LCM = int(num / GCD)
        print(str(GCD) + " " + str(LCM))
 
        
except EOFError:
    pass

Python: def gcd(a, b):
    if a == 0:
        return b
    else:
        return gcd(b%a, a)
def lcm(a, b):
    return a*b//gcd(a, b)
while 1:
    try:
        a,b = map(int, input().split(" "))
        print(gcd(a, b),lcm(a, b))
    except:
        break

Python: import math
try:
    while True:
        a, b= map(int, input().split())
        print(math.gcd(a, b),(a*b)//math.gcd(a,b))
except EOFError:
    pass

Python: import sys

for i in sys.stdin:
    a,b=list(map(int, i.split()))
    d=a*b
    if a>b:
        temp=a
        a=b
        b=temp
    c=a%b
    while c!=0:
        a=b
        b=c
        c=a%b
    g=b
    l=int(d/g)
    print("{} {}".format(g,l))

C++: #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll gcd(ll a,ll b){
	return a%b?gcd(b,a%b):b;
}
int main(){
	ll a,b;
	while(cin>>a>>b)
		cout<<gcd(max(a,b),min(a,b))<<" "<<a*b/gcd(max(a,b),min(a,b))<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
	ios :: sync_with_stdio(false);
	int x, y;
	while(cin >> x >> y) {
		cout << __gcd(x, y) << ' ';
		cout << x / gcd(x, y) * y << '\n';
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main()
{
    int a,b,box1,box2;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        box1=a;
        box2=b;
        while(b)
        {
            int q=a%b;
            a=b;
            b=q;
        }
        printf("%d %d\n",a,box1/a*box2);
    }
    return 0;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	int a,b,c,a1,b1,p,min,max;
	while(cin>>a>>b)
	{
		if(a<b){p=a;a=b;b=p;}
		a1=a;b1=b;
		while(a%b!=0)
		{
			c=a%b;
			a=b;
			b=c;
		}
		min=b;
		max=a1*b1/b;
		cout<<min<<" "<<max<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
    long a,b,t,m,n,l;
    while(cin >> a >> b)
     {
        if(a>=b){
         m=a;
          n=b; 
        }
        else{
         n=a;
         m=b; 
        }
       while(n!=0)
        {
          t = n;
          n = m%n;
          m= t;
        }
        l = a*b / m;
        cout << m << l << endl;
      }
 return 0;
}

C++: #include<iostream>

using namespace std;


int main() {
	unsigned long long n, m,r,tempn,tempm;
	while (cin >> n >> m) {
		tempn = n, tempm = m;
		if (n < m) { int t = n; n = m; m = t; }
		while (m) {
			r= n % m;
			n = m;
			m = r;
		}
		cout << n << ' ';
		int i;
		for (i = 1; (i*tempn) % tempm != 0; ++i);
			cout << tempn * i << endl;

	}
	return 0;
}

C++: #include<stdio.h>


int main(){
	long long int x,y;
	long long int i,j;
	while(scanf("%lld%lld",&i,&j),i){
		x=i,y=j;
		while(i==j){
			if(i>j){
				i=i-j;
			}else{
				j=j-i;
			}
		}
		y=x*y/i;
		x=i;


		printf("%lld %lld\n",x,y);
	}

	return 0;
}

C++: #include <stdio.h>
#include <math.h>

int u(int a, int b);
int l(int a, int b);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    gcd = u(a, b);
    lcm = l(a, b);
printf("%d %d\n",lcm, gcd);
    //std::cout << lcm << " " << gcd << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(a==1 || b==1){
    if(a>=b){
      a = a % b;
    }else{
      b = b % a;
    }
  }
  
  if(a==1) return b;
  else     return a;
}

int l(int a, int b){
  int i = 2;
  
  while(1){
    if(a%i==0){
      if(b%i==0){return i;}
      else{i++;}
    }else{
      i++;
    }
  }
}

C++: #include <cstdio>
#include <algorithm>

using namespace std;

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

int main(){
    int a,b;
    while(scanf("%d %d",&a, &b)!=EOF){
        int g = gcd(a,b);
        printf("%d %d\n",g,a/g*b/g*g);
    }
    return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int gcd(int x,int y){
	while(y){
		int t=x%y;
		x=y;
		y=t;
	}
	return x;
}
int main()
{
	int n,m;
	while(scanf("%d%d",&n,&m)==2){
		int x=gcd(n,m);
		printf("%d %d\n",x,n/x*m);
	}
}

C++: #include<stdio.h>
#include<string.h>
#include<iostream> 
#include<queue>
#include<vector> 
#include<algorithm>
#include<utility>
#include<cmath>
#define inf 0x3f3f3f3f
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
ll gcd(ll a,ll b){
	ll t;
	while(b!=0){
		t=a;
		a=b;
		b=t%b;
	}
	return a;
}
int main()
{
	ll a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF){
		ll Gcd=gcd(a,b);
		ll Lcm=a*b/Gcd;
		printf("%lld %lld\n",Gcd,Lcm);
	} 
    return 0;
}

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

int GCD(int a, int b){
	return (b == 0) ? a: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){
		if(a < b)
			swap(a, b);
		cout << GCD(a, b) << " " << LCM(a, b) << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
#include<stdio.h>
using namespace std;

int main(){
	long long a, b, c;
	long long x, y;

	while (cin >> a >> b){
		if (a > b){
			x = a;
			y = b;
		}
		else{
			x = b;
			y = a;
		}
		while (x % y != 0){
			c = x;
			y = c % y;
			x = c;
		}

		cout << y << " " << (a * b / y) << endl;
	}

}

C++: #include<cstdio>
int gcd(int a,int b)
{
	if(b==0)return a;
	else return gcd(b,a%b);
}
int main()
{
	int n,m;
	while(scanf("%d%d",&n,&m)==2)
	{
		int d = gcd(n,m),ans = n/d*m;
		printf("%d %d\n",d,ans);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main() {
  int a, b, m, tmp_a, tmp_b;
  while (cin >> a >> b) {
    tmp_a = a;
    tmp_b = b;
    while (tmp_a != 0 && tmp_b != 0) {
      if (tmp_a > tmp_b) {
        tmp_a = tmp_a % tmp_b;
      } else {
        tmp_b = tmp_b % tmp_a;
      }
    }
    m = max(tmp_a, tmp_b);
    if (m == 0) {
      printf("%d %d\n", 0, 0);
    } else {
      printf("%d %d\n", m, a * b / m);
    }
  }
  return 0;
}

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

typedef long long ll;

ll gcd(ll a, ll b){
return a != 0 ? gcd(b % a, a) : b;
}

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

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

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

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(){
	long long a,b,i;
	while(cin>>a>>b){
		for(i=a;i<2000000000;i+=a){
			if(i%b==0)break;
		    }
		    cout<<a*b/i<<" "<<i<<endl;
		}
	return 0;
	}

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