#include <bits/stdc++.h>
using namespace std;
const long long int INF = (1ll) << 56;
const long long OO = 2e18;
const double pi = 2 * acos(0.0);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  long long int a[n][n];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      a[i][j] = 0;
    }
  }
  if (n == 1 || n == 2)
    cout << "-1" << endl;
  else {
    long long int cnt = 1;
    if (n % 2 == 0) {
      long long int diff = n - 3;
      long long int last = n - 1;
      bool flag = true;
      while (diff-- > 0) {
        if (flag) {
          for (long long int i = 0; i < n; i++) {
            if (a[i][last] == 0) {
              a[i][last] = cnt;
              cnt++;
            }
          }
          for (long long int i = n - 1; i >= 0; i--) {
            if (a[last][i] == 0) {
              a[last][i] = cnt;
              cnt++;
            }
          }
          flag = false;
        } else {
          for (long long int i = 0; i < n; i++) {
            if (a[last][i] == 0) {
              a[last][i] = cnt;
              cnt++;
            }
          }
          for (long long int i = n - 1; i >= 0; i--) {
            if (a[i][last] == 0) {
              a[i][last] = cnt;
              cnt++;
            }
          }
          flag = true;
        }
        last--;
      }
    } else {
      long long int diff = n - 3;
      long long int last = n - 1;
      bool flag = true;
      while (diff-- > 0) {
        if (flag) {
          for (long long int i = 0; i < n; i++) {
            if (a[last][i] == 0) {
              a[last][i] = cnt;
              cnt++;
            }
          }
          for (long long int i = n - 1; i >= 0; i--) {
            if (a[i][last] == 0) {
              a[i][last] = cnt;
              cnt++;
            }
          }
          flag = false;
        } else {
          for (long long int i = 0; i < n; i++) {
            if (a[i][last] == 0) {
              a[i][last] = cnt;
              cnt++;
            }
          }
          for (long long int i = n - 1; i >= 0; i--) {
            if (a[last][i] == 0) {
              a[last][i] = cnt;
              cnt++;
            }
          }
          flag = true;
        }
        last--;
      }
    }
    a[0][0] = cnt + 8;
    a[0][1] = cnt + 4;
    a[0][2] = cnt + 5;
    a[1][0] = cnt + 6;
    a[1][1] = cnt + 1;
    a[1][2] = cnt + 7;
    a[2][0] = cnt;
    a[2][1] = cnt + 2;
    a[2][2] = cnt + 3;
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < n; j++) {
        cout << a[i][j] << " ";
      }
      cout << endl;
    }
  }
}
