#include <bits/stdc++.h>
using namespace std;
int m[505][505];
int main() {
  int n;
  cin >> n;
  if (n < 3) {
    puts("-1\n");
    return 0;
  }
  int maxn = n * n;
  m[0][0] = maxn - 1;
  m[0][1] = maxn - 2;
  m[0][2] = maxn - 3;
  m[1][0] = maxn - 4;
  m[1][1] = maxn - 8;
  m[1][2] = maxn - 7;
  m[2][0] = maxn - 5;
  m[2][1] = maxn;
  m[2][2] = maxn - 6;
  int cnt = 1;
  int k = n;
  while (k > 3) {
    if (k & 1) {
      for (int i = 0; i < k; ++i) {
        m[i][k - 1] = cnt++;
      }
      for (int i = k - 2; i >= 0; --i) {
        m[k - 1][i] = cnt++;
      }
    } else {
      for (int i = 0; i < k; ++i) {
        m[k - 1][i] = cnt++;
      }
      for (int i = k - 2; i >= 0; --i) {
        m[i][k - 1] = cnt++;
      }
    }
    k--;
  }
  if (n > 3) {
    swap(m[0][3], m[1][3]);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      printf("%d ", m[i][j]);
    }
    putchar('\n');
  }
  return 0;
}
