#include using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define ll long long const long long mod=998244353; const long long hmod=46216567629137; ll SQRT(ll a){ ll l=0,r=2e9; while(l!=r){ ll m=(l+r)/2; if(m*msync_with_stdio(0); cout.tie(0); ll K,N; cin>>K>>N; setans; for(ll x=1;x<=1000;x++){ for(ll y=1;y<=10000;y++){ ll cnt=x*x*x*x*x*x+y*y*y*y; if(cnt<=N){ if(cnt%K==0){ cnt/=K; ll b=SQRT(cnt); if(cnt==b*b){ ans.insert(cnt); } } } } } cout<