Go: package main

import (
	"fmt"
)

func main() {
	var a, b int
	for {
		i, _ := fmt.Scan(&a, &b)
		if i == 0 {
			break
		}

		gcd := getGCD(a, b)
		fmt.Println(gcd, getLCM(a, b, gcd))
	}
}

func getGCD(a, b int) int {
	if b == 0 {
		return a
	}
	return getGCD(b, a%b)
}

func getLCM(a, b, gcd int) int {
	return a * b / gcd
}

C++: /* 2012-07-08T09:04:13 */
#define DEBUG_ON
#define CONDITION true
using namespace std;/*{{{*/

#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <sys/time.h>
#include <vector>

#define INF (1e9)
static const double PI (3.14159265358979323846);
static const double EPS (1e-10);

typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef complex<double> P;

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();}
inline double now(){ struct timeval tv; gettimeofday(&tv, NULL); return ((double)(tv.tv_sec) + (double)(tv.tv_usec) * 1e-6); }

#define FOR(i, b, e) for (typeof(b) i = (b); assert((i) <= (e)), i != (e); ++i)
#define REP(i, n) FOR(i, 0, n)

#define IFC(c) if(c) continue;
#define IFB(c) if(c) break;
#define IFR(c, r) if(c) return r;

#define OPOVER(_op, _type) inline bool operator _op (const _type &t) const

#define arrsz(a) ( sizeof(a) / sizeof(a[0]) )

#define F first
#define S second
#define MP(a, b) make_pair(a, b)

#define SZ(a) ((ll)a.size())
#define PB(e) push_back(e)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())

#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(c,it) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define EXIST(s,e) ((s).find(e)!=(s).end())

#define BIT(n) (1ULL << (n))
#define BITOF(n, m) ((n) >> (m) & 1)

#define RANGE(a, b, c) ((a) <= (b) && (b) <= (c))

#ifdef DEBUG_ON
#define dprt(fmt, ...) if (CONDITION) fprintf(stderr, fmt, __VA_ARGS__)
#define darr(a) if (CONDITION) copy( (a), (a) + arrsz(a), ostream_iterator<int>(cerr, " ") ); cerr << endl
#define darr_range(a, f, t) if (CONDITION) copy( (a) + (f), (a) + (t), ostream_iterator<int>(cerr, " ") ); cerr << endl
#define dvec(v) if (CONDITION) copy( ALL(v), ostream_iterator<int>(cerr, " ") ); cerr << endl
#define darr2(a, n, m) if (CONDITION) FOR(i, 0, (n)){ darr_range( (a)[i], 0, (m) ); }
#define dvec2(v) if (CONDITION) FOR(i, 0, SZ(v)){ dvec( (v)[i] ); }
#define WAIT() if (CONDITION) { string _wait_; cerr << "(hit return to continue)" << endl; getline(cin, _wait_); }
#else
#define cerr if(0) cerr
#define dprt(fmt, ...)
#define darr(a)
#define darr_range(a, f, t)
#define dvec(v)
#define darr2(a, n, m)
#define dvec2(v)
#define WAIT()
#endif
/*}}}*/

ll lcm(ll a, ll b)
{
	if (a == 0 || b == 0) {
		return 0;
	}
	if (a < b) {
		swap(a, b);
	}
	ll am = a, bm = b;
	while (true) {
		if (am == bm) {
			return am;
		}
		if (bm > am) {
			swap(a, b);
			swap(am, bm);
		}
		bm += b;
	}
}

ll gcd(ll a, ll b)
{
	if (a == 0 || b == 0) {
		return 0;
	}
	if (a < b) {
		swap(a, b);
	}
	while (true) {
		if (a % b == 0) {
			return b;
		}
		ll buf = a;
		a = b;
		b = buf % b;
	}
}

int main(int argc, char const* argv[])
{
	ll a, b;
	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(){
  while(true){
    int a, b;
    cin >> a >> b;

    if(cin.eof())
      break;

    int g = gcd(a, b);
    cout << g << ' ' << a/g*b << endl;
  }

  return 0;
}

C++: def get_input():
    while True:
        try:
            yield ''.join(raw_input())
        except EOFError:
            break

if __name__ == '__main__':
    a = list(get_input())

for n in a:
    inl=n.split()
    num=inl[0]+inl[1]
    l=list(num)
    time=0
    for i in l:
        time+=1
    print time

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

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

int gcd(int a, int b) {
  return b != 0 ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
  return a / gcd(a, b) * b;
}
int a,b;

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

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

int main() {
	int a, b,i;
		while (cin >> a >> b) {
			for (i = a; i > 0; i--) {
				if (b%i == 0 && a%i == 0) {
					cout << i << " ";
					break;
				}
				if (i == 0)
					cout << 1 << " ";
			}
			if (a > b)
				i = a;
			else
				i = b;
			while (i%b != 0) {
				i += a;
			}

			if (a > b) {
				for (i = a; i%b; i += a);
				cout << i << endl;
			}
			else {
				for (i = b; i%a; i += b);
				cout << i << endl;
			}
		}
	return 0;
}

C++: #include <stdio.h>

int gcd(int a, int b){
	int r;
	while(b > 0){
		r = a % b;
		a = b;
		b = r;
	}
	return a;
}
int lcm(int a, int b){
	return a / gcd(a, b) * b;
}

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

	return 0;
}

C++: #include <stdio.h>

int gcd_num;

void gcd(int a, int b){
	int tmp;

	if(a < b){
		tmp = a;
		a = b;
		b = tmp;
	}

	tmp = a % b;
	if(tmp == 0){
		printf("%d ", b);
		gcd_num = b;
	}else{
		gcd(b, tmp);
	}
	return;
}

void lcm(int a, int b){
	printf("%d\n", gcd_num * (a / gcd_num) * (b / gcd_num));
}

int main(void){
	int a, b;
	int tmp;

	while(scanf("%d %d", &a, &b) != -1){
		gcd(a, b);
		lcm(a, b);
	}
}

C++: /*
 0005-GCD_and_LCM.cpp
 
 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005
 */

#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int a,b;
    while(cin>>a>>b){
        int temp_a = a;
        int temp_b = b;
        while(1){
            int l = max(temp_a,temp_b);
            int r = min(temp_a,temp_b);
            l = l-r;
            if(l==r){
                cout<<l<<" "<<a/l * b/l * l <<endl;
                break;
            }else{
                temp_a = l;
                temp_b = r;
            }
        }
    }
}

C++: #include <iostream>
using namespace std;
int gcd(int,int); //最大公約数
int lcm(int,int); //最小公倍数
int main(){
    int a,b,c,d;
    while (1){
        cin >> a >> b;
        if(cin.eof()){break;}
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }
}

int gcd(int a,int b){
    int n;
    if (a>b){
        n=b;
        b=a;
        a=n;
    }
    while(b%a!=0){
        n=b%a;
        b=a;
        a=n;
    }
    return n;
}

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

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

int gcd(int a, int b){

int p,q,r;

if(a<b){p=b;b=a;a=p;

}

   while(r!=0){
   q=b/a;
   r=b%a;
   b=a;
   a=r;
   }
   return b;
}

int main(void)
{    int a, b;
     while((r=b%a)!=0){
  q=b/a;
  b=a;
  a=r;
  }
  return a;
}

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

using namespace std;

int a, b;
int gcd, lcm;

void GCD(){

	int big, small;

	big = a;
	small = b;

	while (big) {
		if (small > big) swap(big, small);
		big = big % small;
	}
	gcd = small;

}

void LCM() {
	lcm = a / gcd * b;
}




int main(){
	while (cin >> a >> b) {

		GCD();
		LCM();
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}