#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
void fio() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long double pi = 3.14159265358979323846;
const ll mod = 998244353;
ll pmat[3][4] = {{4, 3, 8, 11}, {7, 1, 2, 10}, {5, 6, 9, 12}};
ll mat[505][505];
void solve() {
  ll n;
  cin >> n;
  if (n <= 2) {
    cout << -1 << '\n';
    return;
  }
  ll mat[n + 1][n + 1];
  for (long long i = 0; i < (3); i++)
    for (long long j = 0; j < (4); j++) mat[i][j] = pmat[i][j];
  int cur = 12;
  for (long long j = (4); j < (n); j++) {
    if (j % 2 == 1) {
      for (long long i = (2); i >= 0; i--) mat[i][j] = ++cur;
    } else {
      for (long long i = 0; i < (3); i++) mat[i][j] = ++cur;
    }
  }
  for (long long j = (n - 1); j >= 0; j--) {
    if ((n - j) % 2 == 1) {
      for (long long i = (3); i < (n); i++) {
        mat[i][j] = ++cur;
      }
    } else {
      for (long long i = (n - 1); i >= (3); i--) {
        mat[i][j] = ++cur;
      }
    }
  }
  for (long long i = 0; i < (n); i++)
    for (long long j = 0; j < (n); j++) {
      if (i >= 3 || j >= 3)
        mat[i][j] = n * n - mat[i][j] + 1;
      else
        mat[i][j] += n * n - 9;
    }
  for (long long i = 0; i < (n); i++) {
    for (long long j = 0; j < (n); j++) {
      if (j) cout << " ";
      cout << mat[i][j];
    }
    cout << '\n';
  }
}
int main() {
  fio();
  int T;
  T = 1;
  while (T--) solve();
}
