#include <iostream>
#include <numeric>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;

    cout << gcd(a, b) << "\n";
    cout << lcm(a, b) << "\n";

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: