#include using namespace std; const vector dx_2d = {1,-1,0,0}; const vector dy_2d = {0,0,1,-1}; void Yyy(){ cout << "Yes" << endl; } void Nnn(){ cout << "No" << endl; } void fixprecision(){ cout << fixed << setprecision(20); } template bool chmin(T& a,T b){ if(a > b){ a = b; return true; } else return false; } template bool chmax(T& a,T b){ if(a < b){ a = b; return true; } else return false; } int main(){ long long int A,B; cin >> A >> B; vector> AP(0),BP(0); long long int a=A,b=B; for(long long int i=2;i*i<=A;i++){ if(a%i == 0){ long long int cnt = 0; while(a%i == 0){ cnt++; a /= i; } AP.push_back(make_pair(i,cnt)); } } if(a != 1) AP.push_back(make_pair(a,1)); for(long long int i=2;i*i<=B;i++){ if(b%i == 0){ long long int cnt = 0; while(b%i == 0){ cnt++; b /= i; } BP.push_back(make_pair(i,cnt)); } } if(b != 1) BP.push_back(make_pair(b,1)); for(int i=0;i