#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& it : v) is >> it;
  return is;
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, set<T> second) {
  os << "{ ";
  for (auto s : second) os << s << " ";
  return os << "}";
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " |";
  __f(comma + 1, args...);
}
void solve() {
  int n;
  cin >> n;
  int on = n;
  if (n <= 2) {
    cout << -1 << '\n';
    return;
  }
  vector<vector<int> > inc{{9, 6, 7}, {5, 3, 8}, {1, 2, 4}};
  vector<vector<int> > mat(n + 1, vector<int>(n + 1));
  int p = 1;
  if (n % 2 and n >= 5) {
    for (int j = 1; j <= n - 1; ++j) {
      mat[n][j] = p++;
    }
    for (int i = n; i >= 1; --i) {
      mat[i][n] = p++;
    }
    n--;
  }
  for (int sj = n; sj > 3; --sj) {
    for (int i = 1; i <= sj; ++i) {
      mat[i][sj] = p++;
    }
    for (int j = sj - 1; j >= 1; --j) {
      mat[sj][j] = p++;
    }
    sj--;
    if (sj == 3) {
      break;
    }
    for (int j = 1; j <= sj - 1; ++j) {
      mat[sj][j] = p++;
    }
    for (int i = sj; i >= 1; --i) {
      mat[i][sj] = p++;
    }
  }
  for (int i = 1; i <= 3; ++i) {
    for (int j = 1; j <= 3; ++j) {
      mat[i][j] = p + inc[i - 1][j - 1] - 1;
    }
  }
  for (int i = 1; i <= on; ++i) {
    for (int j = 1; j <= on; ++j) {
      cout << mat[i][j] << " ";
    }
    cout << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
