#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n, k; cin >> n >> k; if (k == 0) { cout << -1 << endl; return 0; } rep(i, n) { rep(j, n) { int d = (i * n + j - k + n * n) % (n * n); cout << d + 1 << " "; } cout << endl; } return 0; }