#include using namespace std; #define rep(i,n) for (int i=0; i<(n); ++i) #define nall(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define Yes cout << "Yes" << endl #define No cout << "No" << endl templateinline bool chmax(T&a,U b){if(ainline bool chmin(T&a,U b){if(a>b){a=b;return 1;}return 0;} using ll = long long; using ull = unsigned long long; using P = pair; const int inf = (1e9); const ll INF = (1e18)+(1e9); const ll dx[] = {0,1,0,-1,1,1,-1,-1}; const ll dy[] = {1,0,-1,0,1,-1,1,-1}; //#include //using namespace atcoder; //using mint = modint998244353; int testcase(){ ll n,k; cin >> n >> k; if(k==0){ cout << -1 << endl; return 0; } vector> ans(n,vector(n)); ll total = n*n; rep(i,k-1){ ll now = total-i-1; ll x=now/n,y=now%n; ans[x][y] = now+1; } ans[0][0] = total-k+1; rep(i,total-k+1){ ll x = i/n,y=i%n; if(ans[x][y]==0){ ans[x][y] = i; } } rep(i,n){ rep(j,n){ cout << ans[i][j] << ' '; } cout << endl; } return 0; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); //int t=1; //cin >> t; //while(t--) testcase(); return 0; }