#include <bits/stdc++.h>
using namespace std;
int n;
int ans[501][501], now;
int main() {
  cin >> n;
  if (n < 3) {
    cout << -1;
    return 0;
  }
  ans[1][1] = 7;
  ans[1][2] = 6, ans[1][3] = 9;
  ans[2][1] = 8;
  ans[2][2] = 2, ans[2][3] = 5;
  ans[3][1] = 1;
  ans[3][2] = 3;
  ans[3][3] = 4;
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      ans[i][j] += n * n - 9;
    }
  }
  for (int i = n; i >= 4; i--) {
    ans[i][i] = i + now;
    for (int j = i - 1; j >= 1; j--) {
      ans[j][i] = ans[j + 1][i];
      ans[i][j] = ans[i][j + 1];
      if (i & 1)
        ans[j][i]++, ans[i][j]--;
      else
        ans[j][i]--, ans[i][j]++;
    }
    now += 2 * i - 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << ans[i][j] << ' ';
    }
    cout << endl;
  }
  return 0;
}
