#include using namespace std; int main() { long a, b; cin>>a>>b; vector ds; long sum = a + b; for (int i=1; i<=sqrt(sum); i++) { if (sum % i == 0) { ds.push_back(i); if (i != sum / i) { ds.push_back(sum / i); } } } sort(ds.begin(), ds.end()); for (long c: ds) { if ((a + b) % c != 0) { continue; } if ((c + a) % b != 0) { continue; } if ((b + c) % a != 0) { continue; } cout<