#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //eolibraries #define lnf 3999999999999999999 #define inf 999999999 #define PI 3.14159265359 #define endl "\n" #define fi first #define se second #define pb push_back #define eb emplace_back #define ll long long #define all(c) (c).begin(),(c).end() #define sz(c) (int)(c).size() #define mkp(a,b) make_pair(a,b) #define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end()) #define rsz(a,n) a.resize(n) #define pii pair #define rep(i,n) for(int i = 0 ; i < n ; i++) #define drep(i,n) for(int i = n-1 ; i >= 0 ; i--) #define crep(i,x,n) for(int i = x ; i < n ; i++) #define vi vector #define vec(s) vector #define rsz(a,n) a.resize(n) #define rszv(a,n,v) a.resize(n,v) #define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); //eodefine const int max_n = 200000; using namespace std; // int f(vi a) { // int cnt=0; // rep(i,sz(a)) { // rep(j,sz(a)) { // int c=__builtin_popcount(a[i]*a[j]); // if(c%2==0) cnt++; // } // } // return cnt; // } int n,m; int dp[301][max_n]; int val[301]; int main(){ fcin; cin>>n>>m; const int zro=max_n/2; dp[0][zro]=1; crep(a,1,n+1) { crep(b,1,n+1){ int c=__builtin_popcount(a*b); if(c%2==0) val[a]++; } rep(j,max_n) { if(dp[a-1][j]) { dp[a][j+val[a]]=1; dp[a][j-val[a]]=1; } } } if(!dp[n][m+zro]) {cout<<"-1\n"; exit(0);} vi ansx , ansy; int nwval = m+zro; while(n>0) { if(nwval-val[n]>=0 and dp[n-1][nwval-val[n]] == 1) {ansx.pb(n); nwval -= val[n];} else if(nwval+val[n]