#include <bits/stdc++.h>
using namespace std;
int a[500][500];
void func(int n) {
  int k = 1;
  for (int i = n - 1; i > 2; i--) {
    if (i % 2 == 0) {
      for (int j = 0; j <= i; j++) {
        a[j][i] = k++;
      }
      for (int j = i - 1; j >= 0; j--) {
        a[i][j] = k++;
      }
    } else {
      for (int j = 0; j <= i; j++) {
        a[i][j] = k++;
      }
      for (int j = i - 1; j >= 0; j--) {
        a[j][i] = k++;
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      a[i][j] += n * n - 9;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
int main() {
  a[0][0] = 8, a[0][1] = 7, a[0][2] = 6;
  a[1][0] = 5, a[1][1] = 1, a[1][2] = 2;
  a[2][0] = 4, a[2][1] = 9, a[2][2] = 3;
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1;
  } else {
    func(n);
  }
}
