#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long long n, k; cin >> n >> k; long long total = n * n; if (k == 0) { cout << -1 << '\n'; return 0; } long long lowCount = total - k; for (long long i = 0; i < n; i++) { for (long long j = 0; j < n; j++) { long long index = i * n + j + 1; long long value = (index <= k) ? (lowCount + index) : (index - k); if (j > 0) { cout << ' '; } cout << value; } cout << '\n'; } return 0; }