#include <bits/stdc++.h>
using namespace std;
int ans[505][505];
int init[9]{9, 7, 5, 6, 3, 8, 1, 4, 2};
int N, idx;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N;
  if (N < 3) {
    cout << "-1\n";
    exit(0);
  }
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= 3; j++) ans[i][j] = N * N - 9 + init[idx++];
  idx = 1;
  if (N & 1) {
    for (int i = 1; i <= N; i++) {
      if (i & 1) {
        for (int j = N; j > 3; j--) ans[i][j] = idx++;
      } else {
        for (int j = 4; j <= N; j++) ans[i][j] = idx++;
      }
    }
    for (int j = 3; j >= 1; j--) {
      if (j & 1) {
        for (int i = N; i > 3; i--) ans[i][j] = idx++;
      } else {
        for (int i = 4; i <= N; i++) ans[i][j] = idx++;
      }
    }
  } else {
    for (int j = N; j >= 1; j--) {
      if (j & 1) {
        for (int i = N; i >= 1; i--)
          if (!ans[i][j]) ans[i][j] = idx++;
      } else {
        for (int i = 1; i <= N; i++)
          if (!ans[i][j]) ans[i][j] = idx++;
      }
    }
  }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= N; j++) cout << ans[i][j] << " \n"[j == N];
  return 0;
}
