#include <bits/stdc++.h>
using namespace std;
const int t[16] = {4, 3, 6, 12, 7, 5, 9, 15, 14, 1, 11, 10, 13, 8, 16, 2};
void build(vector<vector<int>>& a, int n, int inc = 0) {
  if (n == 4) {
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) a[i][j] = t[i * n + j] + inc;
  } else if (n % 2 == 0) {
    for (int i = 0; i < n; ++i) a[n - 1][i] = i + inc + 1;
    for (int i = n - 2; i >= 0; --i) a[i][n - 1] = a[i + 1][n - 1] + 1;
    build(a, n - 1, inc + 2 * n - 1);
  } else {
    for (int i = 0; i < n; ++i) a[i][n - 1] = i + inc + 1;
    for (int i = n - 2; i >= 0; --i) a[n - 1][i] = a[n - 1][i + 1] + 1;
    if (n == 5) swap(a[n - 1][0], a[n - 1][1]);
    build(a, n - 1, inc + 2 * n - 1);
  }
}
int main() {
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1;
  } else if (n == 3) {
    cout << "1 7 9 \n"
         << "3 2 5 \n"
         << "4 8 6 ";
  } else {
    vector<vector<int>> ans(n, vector<int>(n));
    build(ans, n);
    for (auto& u : ans) {
      for (auto& v : u) cout << v << ' ';
      cout << endl;
    }
  }
  return 0;
}
