Problem: Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd.

Input

The only line contains odd integer n (1 ≤ n ≤ 49).

Output

Print n lines with n integers. All the integers should be different and from 1 to n2. The sum in each row, column and both main diagonals should be odd.

Examples

Input

1


Output

1


Input

3


Output

2 1 4
3 5 7
6 9 8

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct FASTINPUT {
  void f(string& s) {
    char buf[200005];
    long long a = scanf("%s", buf);
    a++;
    s = buf;
  }
  void f(long long& x) {
    long long a = scanf("%lld", &x);
    a++;
  }
  void f(int& x) {
    long long a = scanf("%d", &x);
    a++;
  }
  template <typename A, typename B>
  void f(pair<A, B>& p) {
    f(p.first);
    f(p.second);
  }
  template <typename A>
  void f(vector<A>& x) {
    for (auto& y : x) f(y);
  }
  void read() {}
  template <typename Head, typename... Tail>
  void read(Head& H, Tail&... T) {
    f(H);
    read(T...);
  }
};
struct FASTOUTPUT {
  void f(string s) { printf("%s", s.c_str()); }
  void f(long long x) { printf("%lld", x); }
  void f(int x) { printf("%d", x); }
  void f(char x) { printf("%c", x); }
  void f(const char* a) { printf("%s", a); }
  void print() {}
  template <typename Head, typename... Tail>
  void print(Head H, Tail... T) {
    f(H);
    print(T...);
  }
};
struct DEBUG {
  string open = "[", close = "]", sep = ", ";
  string f(string s) { return s; }
  string f(char c) { return string(1, c); }
  string f(int x) { return to_string(x); }
  string f(long long x) { return to_string(x); }
  string f(double x) { return to_string(x); }
  string f(const char* a) { return a; }
  template <typename A, typename B>
  string f(pair<A, B> p) {
    return open + f(p.first) + sep + f(p.second) + close;
  }
  template <typename A>
  string f(A v) {
    string s = open;
    for (auto a : v) {
      if (s != open) {
        s += sep;
      }
      s += f(a);
    }
    s += close;
    return s;
  }
  void show() { cout << endl; }
  template <typename Head, typename... Tail>
  void show(Head H, Tail... T) {
    cout << " " << f(H);
    show(T...);
  }
};
vector<long long> di = {0, 0, 1, -1, 1, -1, 1, -1};
vector<long long> dj = {1, -1, 0, 0, -1, -1, 1, 1};
long long ob(long long i, long long n) { return i < 0 || i >= n; }
long long tp(long long x) { return (1LL << x); }
long long roundup(long long a, long long b) {
  return a % b ? a / b + 1 : a / b;
}
template <typename A, typename B>
long long exist(A a, B b) {
  return a.find(b) != a.end();
}
vector<string> ssplit(string s) {
  vector<string> ans;
  stringstream ss;
  ss << s;
  while (ss >> s) ans.push_back(s);
  return ans;
}
void upmin(long long& x, long long v) { x = min(x, v); }
void upmax(long long& x, long long v) { x = max(x, v); }
const long long inf = (long long)1e18 + 5;
const long long mod = 1e9 + 7;
const long long mod2 = 998244353;
const double eps = 1e-10;
const string nl = "\n";
void solve() {
  long long n;
  do {
    FASTINPUT inp;
    inp.read(n);
  } while (false);
  vector<vector<long long> > A(n, vector<long long>(n));
  for (long long i = 0; i < n; i++) {
    A[i][n / 2] = 1;
    A[n / 2][i] = 1;
  }
  long long evens = n * n / 2;
  for (long long i = 0; i < n / 2; i++) {
    for (long long j = 0; j < n / 2; j++) {
      if (evens) {
        evens -= 4;
      } else {
        A[i][j] = 1;
        A[n - 1 - i][j] = 1;
        A[i][n - 1 - j] = 1;
        A[n - 1 - i][n - 1 - j] = 1;
      }
    }
  }
  long long o = 1, e = 2;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (A[i][j] == 0) {
        A[i][j] = e;
        e += 2;
      } else {
        A[i][j] = o;
        o += 2;
      }
    }
  }
  for (auto a : A) {
    for (auto x : a) do {
        FASTOUTPUT out;
        out.print(x, ' ');
      } while (false);
    do {
      FASTOUTPUT out;
      out.print(nl);
    } while (false);
  }
}
signed main() {
  long long t = 1;
  for (long long i = 0; i < t; i++) solve();
  return 0;
}