#include<stdio.h> int main() { int gcd(int a, int b); int lcm(int m, int n); int m, n; scanf("%d%d", &m, &n); printf("%d\n", gcd(m, n)); printf("%d\n", lcm(m, n)); return 0; } int gcd(int a, int b) { int t; while (b > 0) { t = b; b = a % b; a = t; } return a; } int lcm(int m, int n) { int l; int gcd(int x, int y); l = m / gcd(m, n)*n; return l; }