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() {
		x, y := nextInts()
		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
		}
		fmt.Fprintf(out, "%d %d\n", y, lcm/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
}

C++: #include<stdio.h>
int main(void)
{
    int  a,b,c,x,y;
	long long i;
	while(scanf("%d %d",&a,&b)!=EOF){
		i=(long long)a*b;
		if(a<b){
			c=a;
			a=b;
			b=c;
		}
		c=a%b;
		while(c!=0){
			a=b;
			b=c;
			c=a%b;
		}
		i=(long long)i/b;
		printf("%d %lld\n",b,i);
	}
	return 0;
}

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

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

int lcm(int x,int y){
  int g = gcd(x,y);
  return (x/g)*y;
}

int main(){
  int x,y;
  while(scanf("%d%d",&x,&y) != EOF) cout << gcd(x,y)<<" "<<lcm(x,y)<<endl;
  return 0;
}

C++: #include<iostream>
long long gcd(long long a,long long b){
  if(b==0) return a;
  gcd(b,(a%b));
}

int main() {
  long long i,j,res;
  while(std::cin>>i>>j) {
    res=gcd(i,j);
    std::cout<<res<<" "<<(i*j)/res<<"\n";
  }
}

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

int main() {
int a,b,e,f,l;
	while(cin>>a>>b){
		e=a;
		f=b;
		while(1){
		if(e>f){
			e=e-f;
		}
	    if(f>e){
	    	f=f-e;
	    }
	    if(f==e){
	    	l=e;
	    	cout<<l<<" "<<(a*b)/l<<endl;
	    	;break;
	    }
		}
	}
	return 0;
}

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

C++: using namespace std;

// GCD
template<class T> inline T gcd(T a, T b) {
    return (a == b) ? a : gcd(b % a, a);
}

// LCM
template<class T> inline T lcm(T a, T b) {
    return (a / gcd(a, b)) * b;
}

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

C++: #include<cstdio>
#include<algorithm>
using namespace std;
typedef unsigned long long ull;
ull gcd(ull m,ull n)
{
    ull t;
    ull a=max(n,m),b=min(n,m);
    while(1)
    {
        t=b;
        if(a%b==0) return b;
        b=a%b;
        a=t;
    }
}
ull lcm(ull m,ull n)
{
    return m/gcd(n,m)*n;
}
int main()
{
    ull a,b;
    while(~scanf("%I64d%I64d",&a,&b))
    {
        printf("%I64d %I64d\n",gcd(a,b),lcm(a,b));
    }
    return 0;
}

C++: #pragma region Macros
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())
#define IN(x, a, b) x >= a and x < b

using namespace std;
using ll = long long;

template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T> constexpr T INF = numeric_limits<T>::max() / 2;
#pragma endregion

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll x, y;
  REP(i, 50) {
    if (cin >> x >> y) {
      ll d = gcd(x, y);
      cout << d << ' ' << x * y / d << endl;
    }
  }

  return 0;
}

C++: #include <stdio.h>
 int gcd(int x, int y){
 if(x%y == 0)
  return y;
 else
  return (gcd(y, x%y)); }

 int main(void){
 long long int x, y;
 while(scanf("%lld %lld", &x, &y)>0){
 long long int lcm=(x*y)/gcd(x, y);
 if(lcm == 0) break;
 printf("%lld %lld\n", gcd(x,y), lcm); }
 return 0;
}

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

using namespace std;

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

long long int lcm(long long int a,long long int b){
	return a*b/gcd(a,b);
}

int main(){
	long long int a,b;
	
	while(scanf("%lld %lld",&a,&b) != EOF){
		cout << gcd(a,b) << " " << lcm(a,b) <<  endl;
	}
	return 0;
}

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

int main(){
    unsigned int a,b,c;
    int g[50],l[50];
    int p;
    for(int i=0;i<50;i++;){
        cin>>a>>b;
        p=a*b;
        while(b!=0){
            c=b;
            b=a%b;
            a=c;
        }
        g[i]=a;
        l[i]=p/g[i];
    }
    for(int i=0;i<50;i++;){
        cout<<g[i]<<" "<<l[i]<<endl;
    }
    return(0);
}

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

int gcd(int u, int v){
	while(u > 0){
		int t;
		if(u < v){ t = u; u = v; v = t; }
		u = u % v;
	}
	return v;
}

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

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/gcd(a,b))*b);
}

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

C++: #include<stdio.h>


void swap(int *a, int *b){
	int w = *a;
	*a = *b;
	*b = w;
}

int gojoho(int a, int b){
	if(b > a){
		swap(&a, &b);
	}
	while(1){
		int r = a % b;
		if(r == 0){
			break;
		}
		a = b;
		b = r;
	}
	return b;
}

int main(){
	int a, b;

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

C++: #include <stdio.h>
int GCD(int a, int b)
{
	return b == 0 ? a : GCD(b, a%b);
}
long long int lcm(long long int a, long long int b)
{
	return (a*b / GCD(a, b));
}

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

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

int main(){
    unsigned int a,b,c;
    cin>>a>>b;
    int g,l,p;
    p=a*b;
    while(b!=0){
        c=b;
        b=a%b;
        a=c;
    }
    g=a;
    l=p/g;
    cout<<g<<" "<<l<<endl;
}

C++: #include <iostream>


using namespace std;

int main(){
	int a;
	int b;
	int ii = 1;
	cin >> a >> b;
	for (int i = 0; i <= 2000000000; i++){
		int c = ii / a * a;
		int d = ii / b * b;
		if (ii == c&&ii == d){
			cout << a * b / ii <<  " " <<ii<< endl;
			break;
		}
		else ii++;

	}

	return 0;
}

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

typedef long long ll;

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


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

C++: #include <iostream>
#include <vector>
#include <bitset>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <stack>
#include <queue>
#include <stdio.h>
#include <limits.h>
#include <string.h>

using namespace std;
/*
 greatest common division
 
 8 6 
 
 8%6 2
 
 */
int calcGCD(int a, int b){
    if(b == 0) return a; 
    else return calcGCD(b%a, a%b);
}

int calcLCM(int a, int b){
    int t = calcGCD(a, b);
    //cout<<t<<endl;
    if(t != 0) return (a / t * b);
    else return 0;
}

int main(){
    int n,m;
    while(cin>>n>>m){
        cout<<calcGCD(n,m)<<" "<<calcLCM(n,m)<<endl;
    }
}

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

C++: include<iostream>
long long gcd(long long a,long long b){
  if(b==0) return a;
  gcd(b,(a%b));
}

int main() {
  long long i,j,res;
  while(std::cin>>i>>j) {
    res=gcd(i,j);
    std::cout<<res<<" "<<(i*j)/res<<"\n";
  }
}