#include <bits/stdc++.h>
using namespace std;
int mat[505][505];
int pat[3][3] = {{7, 6, 8}, {9, 3, 4}, {1, 2, 5}};
int main() {
  ios_base ::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n <= 2) return cout << -1 << endl, 0;
  int counter = 1;
  int f = n % 2;
  int lim = n - 3;
  for (int i = 0; i < n; i++) {
    if (i % 2 != f) {
      if (n - i <= 3) {
        for (int j = 0; j < lim; j++) mat[i][j] = counter++;
      } else {
        for (int j = 0; j < n; j++) mat[i][j] = counter++;
      }
    } else {
      if (n - i <= 3) {
        for (int j = lim - 1; j >= 0; j--) mat[i][j] = counter++;
      } else {
        for (int j = n - 1; j >= 0; j--) mat[i][j] = counter++;
      }
    }
  }
  for (int i = 1; i < 4; i++) {
    for (int j = 1; j < 4; j++)
      mat[n - i][n - j] = pat[3 - i][3 - j] + counter - 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << mat[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
