#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e2 + 10;
int n, a[MAXN][MAXN], p;
int main() {
  cin >> n;
  if (n <= 2) return cout << -1 << endl, 0;
  a[1][1] = 1, a[1][2] = 7, a[1][3] = 9;
  a[2][1] = 3, a[2][2] = 2, a[2][3] = 5;
  a[3][1] = 4, a[3][2] = 8, a[3][3] = 6;
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= 3; j++) a[i][j] += n * n - 9;
  for (int i = 4; i <= n; i++) {
    if (i & 1) {
      for (int j = 1; j < i; j++) a[i][j] = ++p;
      a[i][i] = ++p;
      for (int j = i - 1; j >= 1; j--) a[j][i] = ++p;
    } else {
      for (int j = 1; j < i; j++) a[j][i] = ++p;
      a[i][i] = ++p;
      for (int j = i - 1; j >= 1; j--) a[i][j] = ++p;
    }
  }
  for (int i = 1; i <= n; i++, cout << endl)
    for (int j = 1; j <= n; j++) cout << a[i][j] << ' ';
  return 0;
}
