#include <bits/stdc++.h>
using namespace std;
const int N = 510;
const int INF = 1e9 + 10;
const int EPS = 1e-9;
int arr[N][N];
int a1[3][3] = {{6, 5, 9}, {7, 4, 3}, {1, 2, 8}};
int a2[3][3] = {{6, 7, 1}, {5, 4, 2}, {9, 3, 8}};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, num = 1;
  cin >> n;
  if (n == 3) {
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) cout << a1[i][j] << ' ';
      cout << '\n';
    }
    return 0;
  }
  if (n < 3) {
    cout << -1;
    return 0;
  }
  int u = n, r = n;
  while (true) {
    for (int j = u; j > n - u + 1; j--) arr[j][n - u + 1] = num++;
    for (int j = n - u + 1; j < u; j++) arr[n - u + 1][j] = num++;
    r--;
    if (r == 3 && n % 2 == 0) {
      arr[n - u + 1][u] = num;
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          arr[n - u + 2 + i][n - u + 2 + j] = a2[i][j] + num;
        }
      }
      break;
    }
    for (int j = n - u + 1; j < u; j++) arr[j][u] = num++;
    for (int j = u; j > n - u + 1; j--) arr[u][j] = num++;
    r--;
    if (r == 3 && n % 2 == 1) {
      num--;
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          arr[u - 1 - i][u - 1 - j] = a2[i][j] + num;
        }
      }
      break;
    }
    u--;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << arr[i][j] << ' ';
    cout << '\n';
  }
}
