#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int res[502][502];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1 << endl;
    return 0;
  }
  if (n == 3) {
    cout << "1 2 5\n7 6 9\n8 3 4\n";
    return 0;
  }
  if (n == 4) {
    cout << "4 3 6 12\n7 5 9 15\n14 1 11 10\n13 8 16 2" << endl;
    return 0;
  }
  res[0][n - 1] = 1;
  res[0][n - 2] = n * n;
  int c = 2;
  for (int x = n - 3; x >= 0; --x) res[0][x] = c++;
  for (int x = 0; x < n; ++x) res[1][x] = c++;
  for (int y = 2; y < n - 2; ++y) res[y][n - 1] = c++;
  for (int y = n - 3; y >= 2; --y) res[y][n - 2] = c++;
  bool dir = 0;
  for (int y = 2; y < n; ++y) {
    if (dir) {
      for (int x = 0; x < n - 2; ++x) res[y][x] = c++;
    } else {
      for (int x = n - 3; x >= 0; --x) res[y][x] = c++;
    }
    dir = !dir;
  }
  res[n - 1][n - 2] = c++;
  res[n - 1][n - 1] = c++;
  res[n - 2][n - 2] = c++;
  res[n - 2][n - 1] = c++;
  for (int y = 0; y < n; ++y) {
    for (int x = 0; x < n; ++x) {
      cout << res[y][x] << ' ';
    }
    cout << '\n';
  }
  return 0;
}
