Go: package main

import (
	"fmt"
	"bufio"
	"os"
	"strings"
	"strconv"
)

func getInputAsInt(in string) (int, int) {
	inArr := strings.Split(in, " ")
	// Atoi(s string) (i int, err error) のerrは捨てる
	val1, _ := strconv.Atoi(inArr[0])
	val2, _ := strconv.Atoi(inArr[1])
	return val1, val2
}

func euclidean(val1, val2 int) (int) {
	surp := 1
	for  {
		surp = val1 % val2
		if surp != 0 {
			val1 = val2
			val2 = surp
		} else {
			break
		}
	}
	return val2
}

func calcLCM(val1, val2, gcd int) (int) {
	return val1/gcd*val2
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	
	for scanner.Scan() {
		val1, val2 := getInputAsInt(scanner.Text())
		gcd := euclidean(val1, val2)
		lcm := calcLCM(val1, val2, gcd)
		fmt.Println(gcd, lcm)
	}
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

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

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

int main() {
  ll 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)
{
	int gcd;
	while (a > 0 && b > 0)
	{
		if (a > b)
		{
			a %= b;
		}
		else
		{
			b %= a;
		}
	}
	if (a > 0)
	{
		gcd = a;
	}
	else
	{
		gcd = b;
	}
	return gcd;
}

int LCM(int a, int b)
{
	int init_a = a;
	int init_b = b;
	while (1)
	{
		while (a > b)
		{
			b += init_b;
		}
		if (a == b) break;
		a += init_a;
	}
	return a;
}

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

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

int main()
{
	int a, b;
	int temp;
	while (1)
	{
		cin >> a >> b;
		if (a < b)
		{
			temp = a;
			a = b;
			b = temp;
		}
		int a_ = a, b_ = b;
		while (a_ % b_ != 0)
		{
			temp = a_ % b_;
			a_ = b_;
			b_ = temp;
		}
		cout << b_ << " " << a * b / b_ << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define dump(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a, b;
  while(1) {
    if(!(cin >> a)) { break; }
    cin >> b;
    ll ans = 0;
    ll x = gcd(a, b);
    ll y = a / x * b;
    cout << x << ' ' << y << endl;
  }
  return 0;
}

C++: /*
 * fudq.cpp
 *
 *  Created on: 2015-10-24
 *      Author: bjfudq
 */
#include <functional>
#include <algorithm>
#include <iostream>
//#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;
//#pragma comment(linker,"/STACK:102400000,102400000")


#define MEM(a) (memset((a),0,sizeof(a)))
#define LEN(a) (int)strlen((a))
#define fr(a) for(int i=0;i<(a);i++)
#define sf(a) scanf("%d",&(a))
#define sf64(a) scanf("%I64d",&(a))
#define sff(a) scanf("%lf",&(a))
#define sfs(a) scanf("%s",(a))
#define sf2(a,b) scanf("%d%d",&(a),&(b))
#define sf3(a,b,c) scanf("%d%d%d",&(a),&(b),&(c))
#define sf2s(a,b) scanf("%s%s",(a),(b))
#define sf2f(a,b) scanf("%lf%lf",&(a),&(b))
#define sf3f(a,b,c) scanf("%lf%lf%lf",&(a),&(b),&(c))
#define sf264(a,b) scanf("%I64d%I64d",&(a),&(b))
#define sf364(a,b,c) scanf("%I64d%I64d%I64d",&(a),&(b),&(c))
#define pf(a) printf("%d\n",(a))
#define pfc(a) printf("%c",(a))
#define pf64(a) printf("%I64d\n",(a))
#define pff(a) printf("%lf\n",(a))
#define pfs(a) printf("%s\n",(a))
#define pf2(a,b) printf("%d %d\n",(a),(b))
#define pf2s(a,b) printf("%s%s\n",(a),(b));
#define pf2f(a,b) printf("%lf %lf\n",(a),(b))
#define pf264(a,b) printf("%I64d %I64d\n",(a),(b))
#define pfn printf("\n")
#define pfk printf(" ")
#define LL long long

const int N=1000010;
const int M=1000010;
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const int dir4[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
const int dir8[8][2]={{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1}};
const double eps=1e-12;
const double PI=acos(-1.0);

inline int sign(double x){return (x>eps)-(x<-eps);}
template<class T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T> inline T Min(T a,T b){return a<b?a:b;}
template<class T> inline T Max(T a,T b){return a>b?a:b;}
/*************************/



int main(){
    LL a,b;
    while(sf264(a,b)!=EOF){
    	LL g=gcd(a,b);
    	pf264(g,a/g*b);
    }
    return 0;
}

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

int main(){
	long long a,b,c,d,e;
	std::cin>>a>>b;
    d=a;
	e=b;	
	if(b > a){
	long long d;
	d = a;
	a = b;
	b = d;
	}
	while(b!=0){
		c = a % b;
		a = b;
		b = c;
	}
	std::cout<<a<<" "<<(d*e)/a;
}

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

int gcd( int a, int b )
{
    int temp;

    if( a < b ) { temp = a; a = b; b = temp; }
    if( b < 1 ) return -1;

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


int main(){
  int a,b;
  while(1){
    cin >> a >> b;
    if(cin.eof())
      break;
    int g=gcd(a,b);
    //printf("%d %d\n",g,a/g*b);
    cout << g << a/g*b << endl;
  }

  return 0;
}

C++: #include<bits/stdc++.h>
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>

using namespace std;
#define EPS 1e-9
#define MAX 505
#define pb push_back
#define mp make_pair
#define ins insert
#define fi first
#define se second
#define pi acos(-1.0)
#define mod 100000007
#define inf 2147483647
#define ll long long int
#define sss stringstream
#define oss ostringstream
#define iss istringstream
#define llu long long unsigned

#define _sq(a) (a)*(a)
#define sz(a) ((int)a.size())
#define gcd(a,b)    __gcd(a,b)
#define lcm(a,b) ((a)*((b)/gcd(a,b)))
#define _max3(a,b,c) max(a, max(b,c))
#define _min3(a,b,c) min(a, min(b,c))
#define FOR(i, n) for(i=0; i<(int)n; i++)
#define FOR1(i, n) for(i=1; i<=(int)n; i++)
#define mem(a) memset(a, 0, sizeof(a))
#define _set(a) memset(a,-1,sizeof(a))
#define FORI(i, a, b) for(i=a; i>=(int)b; i--)
#define FORab(i, a, b) for(i=a; i<=(int)b; i++)
#define popcount(n) __builtin_popcount(n)
#define popcountl(n) __builtin_popcountll(n)
#define sort_rev(a) sort(a.rbegin(), a.rend())
#define sort_all(a) sort(a.begin(), a.end())
#define dis_twopoints(x1,y1,x2,y2) sqrt(_sq(x1-x2) + _sq(y1-y2))
#define foreach(i,n) for(__typeof((n).begin())i =(n).begin();i!=(n).end();i++)

//If Long Long (mask & (1LL << k))
#define check(mask, k) (mask & (1 << k))
#define set1(mask, k) (mask | (1 << k))
#define set0(mask ,k) (mask & (~(1<<k)))

#define SD(a) scanf("%d",&a)
#define SLF(a) scanf("%lf",&a)
#define SC(a) scanf("%c",&a)
#define SS(a) scanf("%s",a)
#define SLLD(a) scanf("%lld", &a)
#define Si64(a) scanf("%I64d", &a)

#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)
int main()
{
    unsigned long long int a,b,n,t,r,gcd,lcm;
    while(cin>>a>>b)
    {
        r=1;
        n=a*b;
        if(b>a)
        {
            t=a;
            a=b;
            b=t;
        }
        while(r!=0)
        {
            r=a%b;
            a=b;
            b=r;
            gcd=a;
        }
        if(a==b)
        {
            gcd=a;
        }
        lcm=n/gcd;
        cout<<gcd<<" "<<lcm<<endl;
    }
    return 0;
}