#include <bits/stdc++.h>
using namespace std;
int a[505][505];
int main() {
  a[500][500] = 7;
  a[500][499] = 6;
  a[500][498] = 9;
  a[499][500] = 8;
  a[499][499] = 5;
  a[499][498] = 4;
  a[498][500] = 1;
  a[498][499] = 3;
  a[498][498] = 2;
  int n;
  scanf("%d", &n);
  if (n <= 2) {
    printf("-1\n");
    return 0;
  }
  int l = 498;
  for (int t = 4; t <= n; ++t) {
    for (int i = l; i <= 500; ++i)
      for (int j = l; j <= 500; ++j) a[i][j] += 2 * t - 1;
    if (t % 2 == 0) {
      int k = 0;
      for (int i = 500; i >= l - 1; --i) a[i][l - 1] = ++k;
      for (int j = l; j <= 500; ++j) a[l - 1][j] = ++k;
      l--;
    } else {
      int k = 0;
      for (int j = 500; j >= l - 1; --j) a[l - 1][j] = ++k;
      for (int i = l; i <= 500; ++i) a[i][l - 1] = ++k;
      l--;
    }
  }
  for (int i = l; i <= 500; ++i) {
    for (int j = l; j <= 500; ++j) printf("%d ", a[i][j]);
    printf("\n");
  }
  return 0;
}
