#include <bits/stdc++.h>
using namespace std;
int N, M;
int A[505][505];
bool swapped;
int main() {
  scanf("%d", &N);
  M = N;
  if (min(N, M) < 2 || M * N < 6) {
    puts("-1");
    return 0;
  }
  if (N == 2 && M >= 3) {
    swapped = 1;
    swap(M, N);
  }
  int now = N * M;
  A[3][1] = now--;
  A[1][2] = now--;
  A[1][1] = now--;
  A[2][1] = now--;
  A[3][2] = now--;
  A[2][2] = now--;
  if (M >= 3) {
    A[2][3] = now--;
    A[1][3] = now--;
    A[3][3] = now--;
  }
  for (int c = 4; c <= M; c++) {
    if (c & 1) {
      for (int r = 1; r <= 3; r++) {
        A[r][c] = now--;
      }
    } else {
      for (int r = 3; r > 0; r--) {
        A[r][c] = now--;
      }
    }
  }
  for (int r = 4; r <= N; r++) {
    if (r & 1) {
      for (int c = 1; c <= M; c++) {
        A[r][c] = now--;
      }
    } else {
      for (int c = M; c > 0; c--) {
        A[r][c] = now--;
      }
    }
  }
  if (swapped) {
    for (int c = 1; c <= M; c++) {
      for (int r = 1; r <= N; r++) {
        printf("%d ", A[r][c]);
      }
      puts("");
    }
  } else {
    for (int r = 1; r <= N; r++) {
      for (int c = 1; c <= M; c++) {
        printf("%d ", A[r][c]);
      }
      puts("");
    }
  }
}
