#include <bits/stdc++.h>
using namespace std;
const int M = 1200000;
int ad[4][4] = {{0, 0, 0, 0}, {0, 9, 8, 6}, {0, 5, 3, 2}, {0, 1, 7, 4}};
int ot[555][555];
int n, m;
int main() {
  cin >> n;
  if (n < 3) {
    cout << -1 << endl;
    return 0;
  }
  int val = 1;
  int x, y;
  if (n & 1)
    x = n, y = 1;
  else
    x = 1, y = n;
  m = n * n - 9;
  while (val <= m) {
    if (x < y) {
      if (y & 1) {
        if (1 == x)
          ot[x][y--] = val;
        else
          ot[x--][y] = val;
      } else
        ot[x++][y] = val;
    } else if (x > y) {
      if (x & 1)
        ot[x][y++] = val;
      else {
        if (1 != y)
          ot[x][y--] = val;
        else
          ot[x--][y] = val;
      }
    } else {
      if (x & 1)
        ot[x--][y] = val;
      else
        ot[x][y--] = val;
    }
    ++val;
  }
  for (int i = (1); i <= (3); ++i)
    for (int j = (1); j <= (3); ++j) ot[i][j] = val + ad[i][j] - 1;
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (n); ++j) cout << ot[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
