#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< P; struct myhash{ size_t operator()(const vi &v) const { hash hsh; size_t ret=0; for(int x:v){ ret ^= hsh(x); ret = ret ^ (ret<<13); ret = ret ^ (ret>>17); ret = ret ^ (ret<<5); } return ret; } }; int main(){ int n; int x; cin>>n>>x; x++; typedef unordered_set ss; // factorize x with n numbers ss S; S.insert(vi(n,1)); for(int p=2;p*p<=x;p++){ while(x%p==0){ x/=p; ss nxt; for(const vi &X : S){ REP(i,n){ vi add(n,0); int nw = X[i]*p; int it = 0; REP(j,n){ while(it==i)it++; if(it