#include <bits/stdc++.h>
using namespace std;
const int N = 502;
const int INF = 1e9;
const int MOD = 1e9 + 7;
int mat[4][4] = {{4, 3, 6, 12}, {7, 5, 9, 15}, {14, 1, 11, 10}, {13, 8, 16, 2}};
int ans[N][N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  while (cin >> n) {
    if (n == 3) {
      cout << "1 7 9\n3 2 5\n4 8 6" << '\n';
    } else if (n <= 2) {
      cout << -1 << '\n';
    } else {
      int id = 0;
      for (int i = 0; i < 4; i++) {
        if (!(i & 1)) {
          for (int j = 0; j < n - 4; j++) ans[i][j] = ++id;
        } else {
          for (int j = n - 4 - 1; j >= 0; j--) ans[i][j] = ++id;
        }
      }
      for (int i = 4; i < n; i++) {
        if (!(i & 1)) {
          for (int j = 0; j < n; j++) {
            if (n > 4 && i == n - 1 && j == n - 3) continue;
            ans[i][j] = ++id;
          }
        } else {
          for (int j = n - 1; j >= 0; j--) {
            if (n > 4 && i == n - 1 && j == n - 3) continue;
            ans[i][j] = ++id;
          }
        }
      }
      if (n > 4) ans[n - 1][n - 3] = ++id;
      for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 4; j++) {
          ans[i][n - 4 + j] = mat[i][j] + id;
        }
      }
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          cout << ans[i][j] << ' ';
        }
        cout << '\n';
      }
    }
  }
}
