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 <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

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

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	ll a, b;
	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << a * b / gcd(a, b) << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
long long  a,b,ta,tb;
	
	while(cin>>a>>b){
	ta=a;tb=b;
	if(a<b)swap(a,b);
	while(1){
		long long  tmp=b;
		b=a%b;
		a=tmp;
		//cout<<a<<b<<endl;
		if(b==0)break;
	}
	cout<<a<<" "<<ta*tb/a<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
	int a, b, c, an, bn;
	int max;
	while(cin >> a >> b) {
		if(a < b) {
			c = a;
			a = b;
			b = c;
		}
		for(int i = b; i > 0; i--) {
			if((a % i == 0)&&(b % i == 0)) {
				max = i;
				break;
			}
		}
		an = a;
		bn = b;
		while(1) {
			if(an < bn) {
				an += a;
			} else if(an > bn) {
				bn += b;
			} else {
				break;
			}
		}

		cout << max << " " <<an << endl;
	}

	return 0;
}

C++: #include<stdio.h>

using namespace std;

int max(int x, int y){
        int r;

        while((r = x % y) != 0){
                x = y;
                y = r;
        }
        return y;
}

long long int small(long long int x,long long  int y, int r){
        if(x * y % r  == 0)
                return x * y / r;
        else
                return x * y;
}       

int main(){
        int x,y,r;

        while((scanf("%ld %ld",&x,&y)) != EOF){
                if(x < y){
                        int num = y;
                        y = x;
                        x = num;
                } 
                cout << max(x,y) << " " << small(x,y,max(x,y)) << endl;
        }
}

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

long long int GCD(long long int a, long long int b) {
    return (b % a == 0) ? a : GCD(b % a, a);
}

long long int LCM(long long int a, long long int b) {
    return (a / GCD(a, b)) * b;
}

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

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 g;
    int n,m;
    int l;
    while(cin>>n>>m){
        if(n>=m)
            g=gcd(n,m);
        else
            g=gcd(m,n);
        l=g*(n/g)*(m/g);
        cout<<g<<" "<<l<<endl;
    }
    return 0;
}

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

int gcd(int a, int b){
    
    if ((0 == a)||(0 == b))
        return 0;
        
    while(a!=b){
        if(a>b)  a=a-b;
        else     b=b-a;
        }
        return a;
}


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

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

int GCD(int x,int y) {
    if (x<y) {
        swap(x,y);
    }
    if (y==0) {
        return x;
    }
    return GCD(y,x%y);
}
int LCM(int x,int y) {
    return x*y/GCD(x,y);
}
int main() {
    int a, b;
    while (cin >> a >> b) {
        printf("%d %d\n",GCD(a,b),LCM(a,b));
    }
    return 0;
}

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

C++: #include <iostream>

int main() {
	long long int a, b, t, ab, gcd, lcm;

	while (std::cin >> a >> b) {
		ab = a * b;
		while (a % b > 0) {
			t = a % b;
			a = b;
			b = t;
		}
		gcd = b;
		lcm = ab / gcd;
		std::cout << gcd << " " << lcm << std::endl;
	}

	return 0;
}

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

typedef long long ll;

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

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

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

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

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

int LCM(int x,int y)
{
  return x * y / GCD(x,y);
}



int main(void)
{
  int a,b;
  while(scanf("%d %d",&a,&b) != EOF)
    {
      if(a<b){
	int k = b;
	b = a;
	a = k;
      }
      printf("%d %d\n",GCD(a,b),LCM(a,b));
    }
}
#include<stdio.h>
#include<string.h>

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

int LCM(int x,int y)
{
  return x * y / GCD(x,y);
}



int main(void)
{
  int a,b;
  while(scanf("%d %d",&a,&b) != EOF)
    {
      if(a<b){
	int k = b;
	b = a;
	a = k;
      }
      printf("%d %d\n",GCD(a,b),LCM(a,b));
    }
}

C++: #include<iostream>


using namespace std;

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

int main(){
  
  long long a,b;
  cin>>a>>b;

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

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

int saidai(int a,int b){
	

	while(a !=b){
		if(a>b){
			a -=b;
		}
		else{
			b -=a;
		}
	}
	
	return a;
}

int main(){
	int a,b,c,d;
	cin>>a;
	cin>>b;

	c=saidai(a,b);
	d=a*b/c;
	cout<<c<<" "<<d;
	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
int main()
{
    int a,b,s,d, l, k;
    while(scanf("%d%d",&a,&b)!=EOF){
    s=a;d=b;l=a;k=b;
    if(a>b){ while(b>0){if(a%b==0&&d%b==0) break; else b=b-1;} printf("%d ",b);}
    else { while(a>0){if(b%a==0&&s%a==0) break; else a=a-1;} printf("%d ",a);
}
    s=l;d=k;a=l;b=k;
    if(a>b){ while(b>0){if(a%b==0&&a%s==0) break; else a=a+1;} printf("%d\n",a);}
    else { while(a>0){if(b%a==0&&b%d==0) break; else b=b+1;} printf("%d\n",b);}
    }
    return 0;
}

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

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