#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int INF = 0x3f3f3f3f;
const int mod = 998244353;
const int b[4][4] = {{0, 0, 0, 0}, {0, 8, 7, 6}, {0, 5, 1, 2}, {0, 4, 9, 3}};
int n, ans[505][505];
int main() {
  scanf("%d", &n);
  if (n <= 2) {
    puts("-1");
    return 0;
  }
  if (n == 3) {
    for (int i = 1; i <= 3; i++) {
      for (int j = 1; j <= 3; j++) printf("%d ", b[i][j]);
      puts("");
    }
    return 0;
  }
  bool flag = ((n - 3) & 1);
  int cnt = 0;
  for (int i = n; i > 3; i--) {
    if (flag) {
      for (int j = 1; j <= i; ++j) ans[i][j] = ++cnt;
      for (int j = i - 1; j >= 1; --j) ans[j][i] = ++cnt;
    } else {
      for (int j = 1; j <= i - 1; ++j) ans[j][i] = ++cnt;
      for (int j = i; j >= 1; --j) ans[i][j] = ++cnt;
    }
    flag ^= 1;
  }
  swap(ans[1][4], ans[2][4]);
  for (int i = 1; i <= 3; ++i)
    for (int j = 1; j <= 3; ++j) ans[i][j] = b[i][j] + cnt;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) printf("%d ", ans[i][j]);
    puts("");
  }
  return 0;
}
