#include <bits/stdc++.h>
using namespace std;
long long mod(long long n) {
  if (n < 0) return -n;
  return n;
}
void solve() {
  long long i = 0, j, k, l, n, m, g, s, r, t, x, y, q, ans = 0;
  cin >> n;
  if (n < 3) {
    cout << -1;
    return;
  }
  long long a[n][n];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) a[i][j] = 0;
  k = 1;
  m = n;
  while (n > 4) {
    if (n % 2) {
      for (i = 0; i < n; i++) a[n - 1][i] = k++;
      for (i = n - 2; i >= 0; i--) a[i][n - 1] = k++;
    } else {
      for (i = 0; i < n; i++) a[i][n - 1] = k++;
      for (i = n - 2; i >= 0; i--) a[n - 1][i] = k++;
    }
    n--;
  }
  if (n >= 4) {
    for (i = 0; i < n; i++) a[i][3] = k++;
    for (i = 0; i < n - 1; i++) a[3][i] = k++;
    n--;
  }
  if (n == 3) {
    a[0][0] = 7 + k;
    a[0][1] = 2 + k;
    a[0][2] = 6 + k;
    a[1][0] = 3 + k;
    a[1][1] = 1 + k;
    a[1][2] = 4 + k;
    a[2][0] = 5 + k;
    a[2][1] = 8 + k;
    a[2][2] = 0 + k;
  }
  n = m;
  for (i = 0; i < n; i++, cout << "\n")
    for (j = 0; j < n; j++) cout << a[i][j] << " ";
}
signed main() {
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
