#include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
ifstream in("input.txt");
ofstream out("output.txt");
const int MAX_N = 500;
int f[MAX_N][MAX_N];
int n;
void print() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << f[i][j] << ' ';
    cout << '\n';
  }
  cout << '\n';
}
int main() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  ;
  cin >> n;
  if (n <= 2) {
    cout << -1;
    return 0;
  }
  if (n == 3) {
    cout << "3 2 7\n 9 1 5\n8 6 4";
    return 0;
  }
  if (n == 4) {
    cout << "4 3 6 12\n7 5 9 15\n14 1 11 10\n13 8 16 2";
    return 0;
  }
  int cur = 1;
  f[n - 2][n - 3] = cur++;
  f[0][n - 3] = cur++;
  f[0][0] = cur++;
  f[n - 1][n - 1] = cur++;
  f[1][1] = cur++;
  f[0][1] = cur++;
  for (int i = 0; i <= n - 2; i++) {
    if (!f[0][i]) f[0][i] = cur++;
  }
  for (int i = n - 2; i >= 0; i--) {
    if (!f[1][i]) f[1][i] = cur++;
  }
  for (int i = 2, k = 0; i <= n - 2; i++, k ^= 1) {
    if (k == 0) {
      f[i][0] = cur++;
      for (int j = 2; j <= n - 2 && !f[i][j]; j++) f[i][j] = cur++;
      f[i][1] = cur++;
    } else {
      for (int j = 1; j <= n - 2 && !f[i][j]; j++) f[i][j] = cur++;
      f[i][0] = cur++;
    }
  }
  if (n % 2 == 0) {
    f[n - 1][1] = cur++;
    f[n - 1][0] = cur++;
  } else {
    f[n - 1][0] = cur++;
    f[n - 1][1] = cur++;
  }
  for (int i = 2; i <= n - 3; i++) f[n - 1][i] = cur++;
  f[n - 2][n - 2] = cur++;
  for (int i = n - 2; i >= 2; i--) f[i][n - 1] = cur++;
  f[0][n - 1] = cur++;
  f[1][n - 1] = cur++;
  f[n - 1][n - 2] = cur++;
  print();
}
