#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<vector<int>> vi(n, vector<int>(n));
  vector<vector<int>> matrix{{6, 5, 9}, {8, 2, 3}, {1, 4, 7}};
  int base = n * n - 9;
  if (n <= 2) {
    cout << -1;
    return 0;
  }
  if (n == 3)
    vi = matrix;
  else if (n == 4) {
    int cnt = 1;
    for (int i = 3; i >= 0; --i) vi[0][i] = cnt++;
    for (int i = 1; i < 4; ++i) vi[i][0] = cnt++;
  } else {
    int cnt = 1;
    for (int i = 0; i < n; ++i) {
      int len = 0;
      if (i < n - 3)
        len = n;
      else
        len = n - 3;
      vi[i][0] = cnt, vi[i][1] = cnt + len - 1;
      if (i % 2) swap(vi[i][0], vi[i][1]);
      for (int j = 2; j < len; ++j) vi[i][j] = cnt + j - 1;
      cnt += len;
    }
  }
  for (int i = n - 3; i < n; ++i) {
    for (int j = n - 3; j < n; ++j) {
      vi[i][j] = base + matrix[i - n + 3][j - n + 3];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << vi[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
