#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> b = {{9, 6, 7}, {5, 3, 8}, {1, 2, 4}};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1 << endl;
    return 0;
  }
  int cur = n * n - 9;
  vector<vector<int>> a(n, vector<int>(n));
  for (int i = n - 4; i >= 0; i--) {
    a[n - 1][i] = cur--;
  }
  for (int i = 0; i <= n - 4; i++) {
    a[n - 2][i] = cur--;
  }
  for (int i = n - 4; i >= 0; i--) {
    a[n - 3][i] = cur--;
  }
  for (int i = n - 4; i >= 0; i--) {
    if ((n - 4 - i) & 1) {
      for (int j = n - 1; j >= 0; j--) {
        a[i][j] = cur--;
      }
    } else {
      for (int j = 0; j < n; j++) {
        a[i][j] = cur--;
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      a[i + n - 3][j + n - 3] = b[i][j] + n * n - 9;
    }
  }
  for (int i = 0; i < n; i++) {
    for (auto v : a[i]) {
      cout << v << " ";
    }
    cout << endl;
  }
  return 0;
}
