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 JAVA):

Solution:
import java.util.*;
import java.io.*;

public class P710C {

  private static void solve() {
    int n = nextInt();

    int nextOdd = 1;
    int nextEven = 2;
    int oddCnt = 1;
    boolean dec = false;

    for (int i = 0; i < n; i++) {
      StringBuilder sb = new StringBuilder();
      for (int j = 0; j < (n - oddCnt) / 2; j++) {
        sb.append(nextEven).append(" ");
        nextEven += 2;
      }

      for (int j = 0; j < oddCnt; j++) {
        sb.append(nextOdd).append(" ");
        nextOdd += 2;
      }

      for (int j = 0; j < (n - oddCnt) / 2; j++) {
        sb.append(nextEven).append(" ");
        nextEven += 2;
      }

      if (oddCnt == n) {
        dec = true;
      }

      oddCnt += (dec ? -2 : 2);
      System.out.println(sb.toString());
    }
  }

  private static void run() {
    br = new BufferedReader(new InputStreamReader(System.in));
    out = new PrintWriter(System.out);

    solve();

    out.close();
  }

  private static StringTokenizer st;
  private static BufferedReader br;
  private static PrintWriter out;

  private static String next() {
    while (st == null || !st.hasMoreElements()) {
      String s;
      try {
        s = br.readLine();
      } catch (IOException e) {
        return null;
      }
      st = new StringTokenizer(s);
    }
    return st.nextToken();
  }

  private static int nextInt() {
    return Integer.parseInt(next());
  }

  private static long nextLong() {
    return Long.parseLong(next());
  }

  public static void main(String[] args) {
    run();
  }
}