#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> a = {
    {1, 7, 9},
    {3, 2, 5},
    {4, 8, 6},
};
int32_t main() {
  long long n;
  cin >> n;
  if (n <= 2)
    cout << "-1\n";
  else {
    long long m = n * n;
    for (auto &i : a)
      for (auto &j : i) j += (m - 9);
    a.resize(n);
    for (auto &i : a) i.resize(n, 0);
    long long s = m - 9, r = 0, c = 0;
    while (s) {
      for (long long j = 0; j < n; j++)
        if (!a[r][j]) a[r][j] = s--, c = j;
      if (s) a[++r][c] = s--;
    }
    for (auto &i : a) {
      for (auto &j : i) cout << j << " ";
      cout << '\n';
    }
  }
}
