#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int negative_infinite = 0xcfcfcfcf;
const double pi = acos(-1);
const int mod = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 5e5 + 117;
const int MAXM = 2e5 + 117;
int n;
int s[7][7] = {{5, 9, 1}, {4, 3, 2}, {8, 7, 6}};
int t[517][517];
void left_up(int id, int num);
void down_right(int id, int num) {
  for (int i = 0; i <= id; i++) t[i][id] = num++;
  for (int j = id - 1; j >= 0; j--) t[id][j] = num++;
  if (id + 1 < n) left_up(id + 1, num);
}
void left_up(int id, int num) {
  for (int j = 0; j <= id; j++) t[id][j] = num++;
  for (int i = id - 1; i >= 0; i--) t[i][id] = num++;
  if (id + 1 < n) down_right(id + 1, num);
}
int main() {
  scanf("%d", &n);
  if (n < 3)
    puts("-1");
  else {
    if (n % 2 == 0)
      left_up(3, 1);
    else
      down_right(3, 1);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i < 3 && j < 3)
          printf("%d ", n * n - 9 + s[i][j]);
        else
          printf("%d ", t[i][j]);
      }
      putchar(10);
    }
  }
  return 0;
}
