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 <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <queue>

#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define INF 1<<30
#define ALEN(ARR) (sizeof(ARR) / sizeof(ARR[0]))
#define MP make_pair
#define mp make_pair
#define pb push_back
#define PB push_back
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define ll long long
#define ull unsigned long long
#define MOD 1000000007

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

int lcm(int a, int b) {
    if(a == 0 || b == 0) {
        cout << "Error" << endl;
        return 0;
    }

    return (a * b / gcd(a, b));
}

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

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

  return 0;
}

C++: #include <cstdio>
#define LOOP(index,times) for(int index=0;index<times;index++)
using namespace std;

int main(){
long a,b,r;
while(scanf("%ld %ld",&a,&b) != EOF){
	
	long c=a*b;
			
	if(b>a){a=r; a=b; b=r;}

	LOOP(i,a%b!=0){
	r=a%b;
	a=b; b=r;		
	}
	printf("%ld %ld\n",r,c/r);
}
return 0;		
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	int a,b,c,d,e,f,maxx=0,data,minn=0,o;
	while (scanf("%d %d",&a,&b)!=-1){
		data=max(a,b);
		while(maxx==0){
			if (a%data==0 && b%data==0) maxx=data;
			data-=1;
		}
		minn=a*b/maxx;
		cout<<maxx<<" "<<minn<<endl;
		maxx=0;
		minn=0;
	}
	return 0;
}

C++: #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 gcd;
	for (int a, b; cin >> a >> b;) {
		gcd = GCD(a, b);
		cout << gcd << " " << a * b / gcd << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,r,G,R,L,tmp;
  while(cin >> a >> b){
    R = a; L = b;
    if(b > a){
      tmp = a; a = b; b = tmp;
    }
    while(1){
	  r = a % b;
	  if(r == 0)
	    break;
	  a = b;
	  b = r;
	   }
    G = b;
    R = R / G;
    L = L / G;
    cout << G <<" "<< R*L*G << endl;
  }
}

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;
}