#include <bits/stdc++.h>
using namespace std;
const int MN = 505;
int n, a[MN][MN];
void solve(int n, int id, int flg) {
  if (n == 3) {
    if (!flg) {
      a[3][1] = ++id;
      a[2][1] = ++id;
      a[2][2] = ++id;
      a[1][1] = ++id;
      a[3][2] = ++id;
      a[2][3] = ++id;
      a[1][3] = ++id;
      a[1][2] = ++id;
      a[3][3] = ++id;
    } else {
      a[1][3] = ++id;
      a[1][2] = ++id;
      a[2][2] = ++id;
      a[1][1] = ++id;
      a[2][3] = ++id;
      a[3][2] = ++id;
      a[3][1] = ++id;
      a[2][1] = ++id;
      a[3][3] = ++id;
    }
    return;
  }
  if (!flg) {
    for (register int i = 1; i <= n; i++) a[n][i] = ++id;
    for (register int i = n - 1; i; i--) a[i][n] = ++id;
  } else {
    for (register int i = 1; i <= n; i++) a[i][n] = ++id;
    for (register int i = n - 1; i; i--) a[n][i] = ++id;
  }
  solve(n - 1, id, flg ^ 1);
}
int main() {
  scanf("%d", &n);
  if (n <= 2) return 0 * puts("-1");
  solve(n, 0, 0);
  for (register int i = 1; i <= n; i++, puts(""))
    for (register int j = 1; j <= n; j++) printf("%d ", a[i][j]);
  return 0;
}
