#include <bits/stdc++.h>
const int MAXN = 510;
using namespace std;
int N;
int mat[MAXN][MAXN];
inline void give_answer() {
  for (int i = 1; i <= N; i++, printf("\n"))
    for (int j = 1; j < N + 1; j++) printf("%d ", mat[i][j]);
}
int main() {
  scanf("%d", &N);
  if (N < 3) {
    printf("-1\n");
    return 0;
  }
  mat[1][1] = N * N;
  mat[1][2] = N * N - 4;
  mat[1][3] = N * N - 3;
  mat[2][1] = N * N - 2;
  mat[2][2] = N * N - 7;
  mat[2][3] = N * N - 1;
  mat[3][1] = N * N - 8;
  mat[3][2] = N * N - 6;
  mat[3][3] = N * N - 5;
  if (N == 3) {
    give_answer();
    return 0;
  }
  int last = 1;
  int is_right = 1, j = 4;
  for (int i = 1; i <= N; i++) {
    for (; j != N + 1 && j != 3; j += is_right) mat[i][j] = last++;
    is_right = (is_right == 1) ? -1 : 1;
    j += is_right;
  }
  is_right = -1;
  j = 3;
  for (int i = N; i > 3; i--) {
    for (; j > 0 && j < 4; j += is_right) mat[i][j] = last++;
    is_right = (is_right == 1) ? -1 : 1;
    j += is_right;
  }
  if (mat[4][1] < mat[4][3]) {
    mat[3][3] = last++;
    mat[2][2] = last++;
    mat[2][3] = last++;
    mat[1][3] = last++;
    mat[2][1] = last++;
    mat[1][1] = last++;
    mat[3][2] = last++;
    mat[1][2] = last++;
    mat[3][1] = last++;
  }
  give_answer();
}
