#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double pi = acos(-1), eps = 1e-8;
const int maxn = 1 << 17;
const int N = 1e3 + 10, M = 1e6 + 7, mod = 998244353;
int n;
int a[N][N];
int main() {
  cin >> n;
  if (n <= 2) {
    cout << -1;
    return 0;
  }
  a[1][1] = 4;
  a[1][2] = 9;
  a[1][3] = 3;
  a[2][1] = 6;
  a[2][2] = 1;
  a[2][3] = 5;
  a[3][1] = 8;
  a[3][2] = 7;
  a[3][3] = 2;
  if (n == 3) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        printf("%d ", a[i][j]);
      }
      printf("\n");
    }
    return 0;
  }
  int now = 0;
  int m = 4;
  for (int i = 1; i <= m; i++) a[i][m] = now--;
  for (int i = m - 1; i >= 1; i--) a[m][i] = now--;
  swap(a[1][m], a[2][m]);
  m = 5;
  while (m <= n) {
    if (m % 2) {
      for (int i = 1; i <= m; i++) a[i][m] = now--;
      for (int i = m - 1; i >= 1; i--) a[m][i] = now--;
    } else {
      for (int i = 1; i <= m; i++) a[m][i] = now--;
      for (int i = m - 1; i >= 1; i--) a[i][m] = now--;
    }
    m++;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      printf("%d ", a[i][j] - now);
    }
    printf("\n");
  }
  return 0;
}
