#include <bits/stdc++.h>
using namespace std;
int ans[515][515];
int sol[3][3] = {{1, 2, 4}, {5, 3, 8}, {9, 6, 7}};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n == 1 || n == 2)
    cout << "-1\n";
  else {
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) ans[i][j] = sol[i][j] + n * n - 9;
    }
    int ct = 1;
    for (int i = 3; i < n; i++) {
      if (i & 1) {
        for (int j = 0; j < i + 1; j++) {
          ans[i][j] = ct;
          ct++;
        }
        for (int j = i - 1; j >= 0; j--) {
          ans[j][i] = ct;
          ct++;
        }
      } else {
        for (int j = 0; j < i + 1; j++) {
          ans[j][i] = ct;
          ct++;
        }
        for (int j = i - 1; j >= 0; j--) {
          ans[i][j] = ct;
          ct++;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) cout << ans[i][j] << ' ';
      cout << '\n';
    }
  }
}
