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
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const double INF = 1e12;

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

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

C++: #include <iostream>

using namespace std;

typedef long long ll;

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

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

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

using namespace std;

int main() {
	long int  a, b;
	while (cin >> a >> b) {
		cout << __gcd(a, b) << " " << a / __gcd(a, b) * b << endl;

	}

}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
    int a,b;
    while(cin >> a >> b){
        int g = __gcd(a,b);
        int l = a / g * b;
        cout << g << " " << l << endl;
    }
}

C++: #include <bits/stdc++.h>
#define int long long
using namespace std;
 
constexpr int gcd(int a, int b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
 
constexpr int lcm(const int &a, const int &b) {
  return a / gcd(a, b) * b;
}
 
signed main() {
  int a, b;
  while (cin >> a >> b) cout << gcd(a, b) << ' ' << lcm(a, b) << endl;
}

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

int main(){
	long a, b, t, gcd, lcm;
	while( cin >> a >>b ){
		t=a*b;
		while(a!=b){
			while(a>b) a-=b;
			while(a<b) b-=a;
		}
		gcd=a;
		lcm=t/gcd;
		cout << gcd << lcm << endl;
	}
 return 0;
}

C++: #include <iostream>

using namespace std;

typedef unsigned long long ull;

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

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

C++: // B.cpp

#include <iostream>
#include <cmath>
#include <string>

using namespace std;

int gcd(int, int);
int lcm(int, int);

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

	return 0;
}

int gcd(int a, int b) {
	int max, min, res;
	
	res = 1;
	
	if(a > b){
		max = a, min = b;
	}
	if(a < b){
		max = b, min = a;
	}
	while(res) {
		res = max % min;
		max = min;
		min = res;
	}
	return max;
}
int lcm(int a, int b) {
	int max, min, res;
	res = 1;
	if(a > b){
		max = a, min = b;
	}
	if(a < b){
		max = b, min = a;
	}
	while(res) {
		res = max % min;
		max = min;
		min = res;
	}
	return a / max * b;
}

C++: #include <iostream>

#define CASE long int

using namespace std;

CASE GCD(CASE x, CASE y)
{
	if (x == 0 || y == 0)
		return x + y;
	else
	{
		if (x >= y)
		{
			x = x - y;
			GCD(x, y);
		}
		else
		{
			y = y - x;
			GCD(x, y);
		}
	}
}

int main(){
	CASE a, b;
		cin >> a;
		cin >> b;
		cout << GCD(a, b) << " " << a * b / GCD(a, b) << 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 saisyou(int a,int b){
	return a*b/saidai(a,b);
}

int main(){
	int a,b,c,d;
	cin>>a; cin>>b;
	c=saidai(a,b);
	d=saisyou(a,b);
	cout<<c<<" "<<d;
	return 0;
}

C++: #include<iostream>


#define ll long long

using namespace std;

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

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


void solver() {
    ll a, b;
    while (cin >> a >> b) {
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
    }
}

int main() {
    solver();
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
    unsigned int a, b;
    while (cin >> a >> b)
    {
        int r = 1;
        unsigned int g = 1, l = 1;
        if (a < b)
        {
            unsigned int _a = a, _b = b;
            while (_b % _a != 0)
            {
                r = _b % _a;
                _b = _a;
                _a = r;
            }
            g = _a;
            a = a / g;
            b = b / g;
            l = g * a * b;
        }
        else if (b < a)
        {
            unsigned int _a = a, _b = b;
            while (_a % _b != 0)
            {
                r = _a % _b;
                _a = _b;
                _b = r;
            }
            g = _b;
            a = a / g;
            b = b / g;
            l = g * a * b;
        }
        cout << g << ' ' << l << endl;
    }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int d(int n,int m)
{
    int t;
    while(m!=0)
    {
        if(n<m) {t=n;n=m;m=t;}
        t=m;
        m=n%m;
        n=t;
    }
    return n;
}
int main()
{
    int t,n,m;
    while(1)
    {
        cin>>n>>m;
        t=d(n,m);
        cout<<t<<" "<<n*(m/t)<<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 saisyou(int a,int b){
	return a*b/saidai(a,b);
}


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

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

C++: #include<stdio.h>
int main(void)
{
	int n,a,s,i,d,c,j,x,g,w,z,m;
	while(scanf("%d %d",&a,&s)!=EOF){
		w=a; z=s;
		if(a==0&&s==0) break;
		if(a<s){
			n=a;
			a=s;
			s=n;
		}
		while(s!=0){
			a=a%s;
			g=a;
			a=s;
			s=g;
		}
		m=(w/a)*(z/a)*a;
		printf("%d %d\n",a,m);	
	}
	return 0;
}

C++: #include <stdio.h>

int main(void) {
	int buf,i,c;
	long int a,b,gcd, lcm;
	
	while(scanf("%ld%ld",&a,&b) != EOF){
		if(b > a){buf = a;a = b;b = buf;}
		for(i = 1;;i++){
			if(b%(a/i) == 0) {gcd = a/i;break;}
		}
		for(i = 1; ;i++){
			if((a*i)%b == 0) {lcm = a*i;break;}
		}
		printf("%d %d\n",gcd, lcm);
	}
	
	return 0;
}