#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 rng(1234);
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1;
  } else if (n == 3) {
    cout << "1 2 4 \n"
            "5 3 8 \n"
            "9 6 7 ";
  } else {
    vector<vector<int>> a(n, vector<int>(n, -1));
    int i = n - 1, j = 0;
    int cnt = -1;
    vector<vector<int>> di = {{-1, 0}, {0, 1}};
    vector<vector<int>> dj = {{0, 1}, {-1, 0}};
    vector<int> endi = {+1, 0};
    vector<int> endj = {0, +1};
    for (int move = 0; move < n - 3; ++move) {
      int m = move % 2;
      a[i][j] = ++cnt;
      for (int r = 0; r < 2; ++r) {
        for (int len = 1; len <= n; ++len) {
          int ii = i + di[m][r];
          int jj = j + dj[m][r];
          if (0 <= ii && ii < n && 0 <= jj && jj < n && a[ii][jj] == -1) {
            i = ii;
            j = jj;
            a[i][j] = ++cnt;
          }
        }
      }
      i += endi[m];
      j += endj[m];
    }
    vector<vector<int>> odd = {
        {4, 8, 7},
        {2, 3, 6},
        {1, 5, 9},
    };
    vector<vector<int>> even = {
        {9, 5, 1},
        {6, 3, 2},
        {7, 8, 4},
    };
    for (int i = n - 3, ii = 0; i < n; ++i, ++ii) {
      for (int j = n - 3, jj = 0; j < n; ++j, ++jj) {
        a[i][j] = (n % 2 ? cnt + odd[ii][jj] : cnt + even[ii][jj]);
      }
    }
    for (auto &v : a) {
      for (auto &e : v) {
        cout << e + 1 << " ";
      }
      cout << "\n";
    }
  }
}
