#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  if (n == 1 || n == 2) {
    cout << -1;
    return;
  }
  vector<vector<long long> > a;
  for (long long i = (0); i < (n); i++) {
    a.push_back(vector<long long>());
    for (long long j = (0); j < (n); j++) {
      a[i].push_back(0);
    }
  }
  long long val = 1;
  while (n > 3) {
    if (n % 2 == 0) {
      for (long long i = (0); i < (n); i++) {
        a[n - 1][i] = val++;
      }
      for (long long i = (n - 1) - 1; i >= (0); i--) {
        a[i][n - 1] = val++;
      }
    } else {
      for (long long i = (0); i < (n); i++) {
        a[i][n - 1] = val++;
      }
      for (long long i = (n - 1) - 1; i >= (0); i--) {
        a[n - 1][i] = val++;
      }
    }
    n--;
  }
  a[0][0] = val++;
  a[0][2] = val++;
  a[1][2] = val++;
  a[1][1] = val++;
  a[2][2] = val++;
  a[1][0] = val++;
  a[2][1] = val++;
  a[2][0] = val++;
  a[0][1] = val++;
  for (long long i = (0); i < (a.size()); i++) {
    for (long long j = (0); j < (a.size()); j++) {
      cout << a[i][j] << " ";
    }
    cout << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
