#include <bits/stdc++.h>
using namespace std;
mt19937 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
const long double PI = 3.141592653589793;
const long long INF = 9223372036854775807ll;
const long long mod = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  if (n <= 2) {
    cout << -1 << '\n';
    return;
  }
  int ar[n + 1][n + 1];
  memset(ar, 0, sizeof(ar));
  if (n % 2) {
    int add = n * n - 9;
    int temp[3][3] = {{7, 6, 8}, {2, 3, 4}, {9, 1, 5}};
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < 3; ++j) {
        ar[i + n - 2][j + n - 2] = temp[i][j] + add;
      }
    }
  } else {
    int add = n * n - 16;
    int temp[4][4] = {
        {6, 5, 4, 3}, {7, 16, 2, 15}, {12, 9, 11, 10}, {8, 1, 14, 13}};
    for (int i = 0; i < 4; ++i) {
      for (int j = 0; j < 4; ++j) {
        ar[i + n - 3][j + n - 3] = temp[i][j] + add;
      }
    }
  }
  int cur = 1;
  for (int i = 1; i <= n; ++i) {
    if (i % 2) {
      for (int j = 1; j <= n; ++j) {
        if (!ar[i][j]) {
          ar[i][j] = cur++;
        }
      }
    } else {
      for (int j = n; j >= 1; --j) {
        if (!ar[i][j]) {
          ar[i][j] = cur++;
        }
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    swap(ar[n][i], ar[n - 1][i]);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cout << ar[i][j] << " ";
    }
    cout << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  solve();
  return 0;
}
