#include <iostream>
using namespace std;
int main() {
	int a, b, c, an, bn;
	int max;
	while(cin >> a >> b) {
		if(a < b) {
			c = a;
			a = b;
			b = c;
		}
		for(int i = b; i > 0; i--) {
			if((a % i == 0)&&(b % i == 0)) {
				max = i;
				break;
			}
		}
		an = a;
		bn = b;
		while(1) {
			if(an < bn) {
				an += a;
			} else if(an > bn) {
				bn += b;
			} else {
				break;
			}
		}

		cout << max << " " <<an << endl;
	}

	return 0;
}