#include <bits/stdc++.h>
using namespace std;
int a[600][600];
int main(void) {
  int num = 1;
  int x = 1, y = 1, z = 1;
  a[1][1] = 1;
  while (num <= 250000) {
    a[x][++y] = ++num;
    for (int j = 0; j < z; j++) a[++x][y] = ++num;
    for (int j = 0; j < z; j++) a[x][--y] = ++num;
    ++z;
    a[++x][y] = ++num;
    for (int j = 0; j < z; j++) a[x][++y] = ++num;
    for (int j = 0; j < z; j++) a[--x][y] = ++num;
    ++z;
  }
  int n;
  scanf("%d", &n);
  if (n == 1 || n == 2) {
    printf("-1");
    return 0;
  }
  a[1][1] = 1, a[1][2] = 3, a[1][3] = 9;
  a[2][1] = 5, a[2][2] = 8, a[2][3] = 7;
  a[3][1] = 4, a[3][2] = 2, a[3][3] = 6;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      printf("%d ", n * n + 1 - a[i][j]);
    }
    printf("\n");
  }
}
