#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
static ll f[500 + 100][500 + 100];
ll n;
ll x, y;
int main() {
  cin >> n;
  if (n <= 2) return puts("-1") * 0;
  ll base = n * n - 3 * 3;
  f[1][1] = 1 + base;
  f[1][2] = 7 + base;
  f[1][3] = 9 + base;
  f[2][1] = 3 + base;
  f[2][2] = 2 + base;
  f[2][3] = 5 + base;
  f[3][1] = 4 + base;
  f[3][2] = 8 + base;
  f[3][3] = 6 + base;
  x = 4, y = 1;
  for (ll i = 1; i <= n * n - 3 * 3;) {
    while (f[x - 1][y]) {
      f[x][y] = i++;
      y++;
    }
    while (x >= 2) {
      f[x][y] = i++;
      x--;
    }
    f[x][y++] = i++;
    while (f[x][y - 1]) {
      f[x][y] = i++;
      x++;
    }
    while (y >= 2) {
      f[x][y] = i++;
      y--;
    }
    f[x++][y] = i++;
  }
  for (ll i = 1; i <= n; i++) {
    for (ll k = 1; k <= n; k++) cout << f[i][k] << " ";
    cout << "\n";
  }
  return 0;
}
