#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int N;
  cin >> N;
  if (N <= 2) {
    cout << -1 << '\n';
    exit(0);
  }
  if (N == 3) {
    cout << " 8 6 3\n";
    cout << " 7 1 9\n";
    cout << " 5 4 2\n";
    exit(0);
  }
  vector<vector<int>> G(N, vector<int>(N));
  G[0][0] = 13;
  G[0][1] = 8;
  G[0][2] = 16;
  G[0][3] = 2;
  G[1][0] = 14;
  G[1][1] = 1;
  G[1][2] = 11;
  G[1][3] = 10;
  G[2][0] = 7;
  G[2][1] = 5;
  G[2][2] = 9;
  G[2][3] = 15;
  G[3][0] = 4;
  G[3][1] = 3;
  G[3][2] = 6;
  G[3][3] = 12;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      G[i][j] += N * N - 16;
    }
  }
  int idx = 0;
  for (int i = 4; i < N; i++) {
    if (i % 4 == 0) {
      for (int j = 0; j < i; j++) {
        G[j][i] = ++idx;
      }
      for (int j = i; j >= 0; j--) {
        G[i][j] = ++idx;
      }
      if (i == N - 1) {
        swap(G[i][0], G[i][1]);
      }
    } else {
      for (int j = 0; j < i; j++) {
        G[i][j] = ++idx;
      }
      for (int j = i; j >= 0; j--) {
        G[j][i] = ++idx;
      }
      if (i == N - 1) {
        swap(G[0][i], G[1][i]);
      }
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cout << G[i][j] << " \n"[j + 1 == N];
    }
  }
  return 0;
}
