#include using namespace std; int main(){ int A,B; cin>>A>>B; vector V; for(long long i = 1;i*i<=(long long)A+B;i++){ if((A+B)%i==0&&i!=A&&i!=B){ V.push_back(i); V.push_back((A+B)/i); } } sort(V.begin(),V.end()); for(int i=0;i