#include <bits/stdc++.h>
using namespace std;
int a[510][510];
int cols[510];
int main() {
  int n, cur = 0;
  scanf("%d", &n);
  if (n == 3) {
    puts("1 7 9");
    puts("3 2 5");
    puts("4 8 6");
    return 0;
  }
  if (n < 3) {
    puts("-1");
    return 0;
  }
  a[0][0] = 4;
  a[0][1] = 3;
  a[0][2] = 6;
  a[0][3] = 12;
  a[1][0] = 7;
  a[1][1] = 5;
  a[1][2] = 9;
  a[1][3] = 15;
  a[2][0] = 14;
  a[2][1] = 1;
  a[2][2] = 11;
  a[2][3] = 10;
  a[3][0] = 13;
  a[3][1] = 8;
  a[3][2] = 16;
  a[3][3] = 2;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      if (i < 4 && j < 4) continue;
      a[i][j] = ++cur;
    }
  for (int i = 0; i < 4; ++i)
    for (int j = 0; j < 4; ++j) a[i][j] += cur;
  if (n > 4) {
    swap(a[n - 1][1], a[n - 1][n - 1]);
    if (n % 2 == 0) {
      swap(a[n - 1][n - 2], a[n - 1][n - 1]);
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) printf("%d ", a[i][j]);
    puts("");
  }
  return 0;
}
