#include <bits/stdc++.h>
using namespace std;
const int MX = 5e2 + 5, MXX = 23;
const long long mod = 1e9 + 7, inf = 1e18 + 6;
int ans[MX][MX];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(9);
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1 << "\n";
    return 0;
  }
  int nm = 1;
  for (int i = 0; i < n - 3; ++i)
    for (int t = 0; t < n; ++t) ans[i][t] = nm, nm++;
  for (int x = n - 3; x < n; ++x)
    for (int y = 0; y < n - 3; ++y) ans[x][y] = nm, nm++;
  if (n > 3) reverse(ans[n - 4] + n - 4, ans[n - 4] + n);
  nm--;
  vector<int> hr = {9, 5, 6, 7, 2, 8, 1, 3, 4};
  int pn = 0;
  for (int i = n - 3; i < n; ++i)
    for (int t = n - 3; t < n; ++t) ans[i][t] = hr[pn] + nm, pn++;
  for (int i = 0; i < n; ++i) {
    for (int t = 0; t < n; ++t) cout << ans[i][t] << ' ';
    cout << "\n";
  }
}
