#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n < 3)
    cout << -1 << endl;
  else {
    vector<vector<int> > ans(n, vector<int>(n));
    int x = 0, y = 0, k = 1, d = 0, flag = 0;
    while (k <= n * n) {
      ans[x][y] = k++;
      if (flag) {
        if (d == 1)
          d = 0;
        else if (d == 2)
          d = 3;
        flag = 0;
      } else {
        int x_ = x + dx[d];
        int y_ = y + dy[d];
        if (x_ < 0 || x_ >= n || y_ < 0 || y_ >= n || ans[x_][y_]) {
          if (d == 0)
            d = 1;
          else if (d == 1) {
            d = 2;
            flag = 1;
          } else if (d == 2) {
            d = 1;
            flag = 1;
          } else if (d == 3)
            d = 2;
        }
      }
      x += dx[d];
      y += dy[d];
    }
    ans[1][n - 1] = n * n;
    ans[2][n - 1] = n * n - 1;
    ans[0][n - 3] = n * n - 2;
    ans[2][n - 2] = n * n - 3;
    ans[2][n - 3] = n * n - 4;
    ans[1][n - 3] = n * n - 5;
    ans[0][n - 2] = n * n - 6;
    ans[0][n - 1] = n * n - 7;
    ans[1][n - 2] = n * n - 8;
    if (n > 3) {
      if (n & 1)
        swap(ans[0][n - 4], ans[1][n - 4]);
      else
        swap(ans[3][n - 1], ans[3][n - 2]);
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) cout << ans[i][j] << " ";
      cout << endl;
    }
  }
  return 0;
}
