#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 100;
const int mod = 1e9 + 7;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int arr[505][505];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  if (n < 3) {
    cout << "-1\n";
  } else {
    int a[3][3] = {{1, 2, 4}, {5, 3, 8}, {9, 6, 7}};
    for (int i = 1; i <= 3; i++) {
      for (int j = 1; j <= 3; j++) {
        arr[i][j] = a[i - 1][j - 1];
      }
    }
    if (n > 3) {
      int cur = n * n - 9;
      int posx = 4, posy = 1;
      for (int aa = 4; aa <= n; aa += 2) {
        string s;
        for (int i = 0; i < aa - 1; i++) {
          s += 'R';
        }
        for (int i = 0; i < aa - 1; i++) {
          s += 'U';
        }
        s += 'R';
        for (int i = 0; i < aa; i++) {
          s += 'D';
        }
        for (int i = 0; i < aa; i++) {
          s += 'L';
        }
        s += 'D';
        int cu = 0;
        while (cur > 0 && cu < (int)s.size()) {
          arr[posx][posy] = cur;
          if (s[cu] == 'L') {
            posy--;
          }
          if (s[cu] == 'R') {
            posy++;
          }
          if (s[cu] == 'U') {
            posx--;
          }
          if (s[cu] == 'D') {
            posx++;
          }
          cu++;
          cur--;
        }
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (i <= 3 && j <= 3) {
          arr[i][j] += n * n - 9;
        }
        cout << arr[i][j] << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}
