#include <bits/stdc++.h>
using namespace std;
int n, ans[505][505];
int main() {
  cin >> n;
  if (n <= 2) return cout << -1, 0;
  int cur = n * n - 9;
  ans[0][0] = 9, ans[0][1] = 5, ans[0][2] = 1;
  ans[1][0] = 6, ans[1][1] = 2, ans[1][2] = 4;
  ans[2][0] = 7, ans[2][1] = 8, ans[2][2] = 3;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) ans[i][j] += cur;
  int x = 0, y = 3, step = 3;
  for (int t = 0; t < n - 2; t++) {
    if (t % 2 == 0) {
      for (int i = 0; i < step; i++) ans[x++][y] = cur--;
      for (int i = 0; i < step; i++) ans[x][y--] = cur--;
      ans[x++][y] = cur--;
      step++;
    } else {
      for (int i = 0; i < step; i++) ans[x][y++] = cur--;
      for (int i = 0; i < step; i++) ans[x--][y] = cur--;
      ans[x][y++] = cur--;
      step++;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << ans[i][j] << ' ';
    cout << '\n';
  }
}
