#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const int maxn = (long long)1e6 + 5;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
int T = 1;
int a[505][505];
void solve() {
  int n;
  cin >> n;
  if (n <= 2) {
    cout << -1;
    return;
  }
  int cnt = 0;
  for (int i = n; i >= 4; --i) a[1][i] = ++cnt;
  for (int i = 4; i <= n; ++i) a[2][i] = ++cnt;
  for (int i = 3; i <= n - 1; ++i) {
    if (i & 1)
      for (int j = n; j >= 1; --j) a[i][j] = ++cnt;
    else
      for (int j = 1; j <= n; ++j) a[i][j] = ++cnt;
  }
  if (n & 1) {
    for (int j = n; j >= 1; --j)
      if (j != 2) a[n][j] = ++cnt;
  } else {
    for (int j = 1; j <= n; ++j)
      if (j != 2) a[n][j] = ++cnt;
  }
  a[n][2] = ++cnt;
  a[1][2] = ++cnt;
  a[2][1] = ++cnt;
  a[2][2] = ++cnt;
  a[1][3] = ++cnt;
  a[2][3] = ++cnt;
  a[1][1] = ++cnt;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) cout << a[i][j] << ' ';
    cout << '\n';
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  while (T--) solve();
  return 0;
}
