#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 998244353;
const int maxn = 507;
ll ans[maxn][maxn];
void solve() {
  int n;
  cin >> n;
  if (n == 1 || n == 2) {
    cout << -1;
    return;
  }
  int cur = 1;
  for (int i = n; i >= 4; i--) {
    if ((i % 2)) {
      for (int j = 0; j < i; j++) {
        ans[j][i - 1] = cur++;
      }
      for (int j = i - 2; j >= 0; j--) {
        ans[i - 1][j] = cur++;
      }
    } else {
      for (int j = 0; j < i; j++) {
        ans[i - 1][j] = cur++;
      }
      for (int j = i - 2; j >= 0; j--) {
        ans[j][i - 1] = cur++;
      }
    }
  }
  cur--;
  ans[0][0] = cur + 9;
  ans[0][1] = cur + 7;
  ans[0][2] = cur + 1;
  ans[1][0] = cur + 5;
  ans[1][1] = cur + 2;
  ans[1][2] = cur + 3;
  ans[2][0] = cur + 6;
  ans[2][1] = cur + 8;
  ans[2][2] = cur + 4;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << ans[i][j] << " ";
    }
    cout << "\n";
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
