#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <class T, class S>
ostream &operator<<(ostream &o, const pair<T, S> &p) {
  return o << '(' << p.first << ", " << p.second << ')';
}
template <template <class, class...> class T, class... A>
typename enable_if<!is_same<T<A...>, string>(), ostream &>::type operator<<(
    ostream &o, T<A...> V) {
  o << '[';
  for (auto a : V) o << a << ", ";
  return o << ']';
}
long long int gr[510][510];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n;
  cin >> n;
  if (n < 3) {
    cout << -1 << endl;
    exit(0);
  }
  gr[0][0] = n * n - 2;
  gr[0][1] = n * n - 3;
  gr[0][2] = n * n;
  gr[1][0] = n * n - 1;
  gr[1][1] = n * n - 6;
  gr[1][2] = n * n - 5;
  gr[2][0] = n * n - 8;
  gr[2][1] = n * n - 7;
  gr[2][2] = n * n - 4;
  long long int nxt = n * n - 9;
  for (long long int i = 0; i < n - 3; i++) {
    if (i & 1) {
      for (long long int j = 0; j < 4 + i; j++) gr[j][3 + i] = nxt--;
      for (long long int j = 2 + i; j > -1; j--) gr[3 + i][j] = nxt--;
    } else {
      for (long long int j = 0; j < 4 + i; j++) gr[3 + i][j] = nxt--;
      for (long long int j = 2 + i; j > -1; j--) gr[j][3 + i] = nxt--;
    }
  }
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < n; j++) cout << gr[i][j] << " \n"[j == n - 1];
}
