#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include <math.h>

#include <iostream>
#include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)

typedef long long ll;

int extgcd(int a, int b, int &x, int &y) {
	int res = a;
	if (b) {
		res = extgcd(b, a % b, y, x);	
		y -= (a/b) * x;
	} else {
		x = 1;
		y = 0;
	}
	return res;
}

int main() {
	int a, b;
	int x, y;
	int gcd, lcm;
	while (scanf("%d%d ", &a, &b) != EOF) {
		if (a >= b) {
			gcd = extgcd(a, b, x, y);
		} else {
			gcd = extgcd(b, a, x, y);
		}

		lcm = a / gcd * b;
		printf("%d %d\n", gcd, lcm);
	}

	return 0;
}