#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
using namespace std;
int gcd(int a, int b) {
	if (b == 0) return a;
	else return gcd(b, a%b);
}
int lcm(long long a, long long b,long long gcmed) {
	return (a*b / gcmed);
}
int main(){
	long long a,b;
	while (cin >> a >> b) {
		long long c = gcd(a, b);
		printf("%lld %lld\n", c, lcm(a, b, c));
	}
}
