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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    CMagicOddSquare solver = new CMagicOddSquare();
    solver.solve(1, in, out);
    out.close();
  }

  static class CMagicOddSquare {

    int odds = -1;
    int evens = 0;

    int nextOdd() {
      return odds = odds + 2;
    }

    int nextEvens() {
      return evens = evens + 2;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int n = in.nextInt();
      int[][] mat = ArrayUtils.createMatrix(n, n, -1);
      int count = 1;
      int add = 2;

      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
          if (j >= (n / 2 - count / 2) && j <= (n / 2 + count / 2)) {
            mat[i][j] = nextOdd();
          }
        }
        if (count == n) {
          add = -2;
        }
        count += add;
      }
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
          if (j > 0) {
            out.print(" ");
          }
          if (mat[i][j] == -1) {
            mat[i][j] = nextEvens();
          }
          out.print(mat[i][j]);
        }
        out.println();
      }
    }

  }

  static class ArrayUtils {

    public static int[][] createMatrix(int n, int m, int initialValue) {
      int[][] ret = new int[n][m];
      for (int[] a : ret) {
        Arrays.fill(a, initialValue);
      }
      return ret;
    }

  }

  static class InputReader implements FastIO {

    private InputStream stream;
    private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
    private static final int EOF = -1;
    private byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int read() {
      if (this.numChars == EOF) {
        throw new UnknownError();
      } else {
        if (this.curChar >= this.numChars) {
          this.curChar = 0;

          try {
            this.numChars = this.stream.read(this.buf);
          } catch (IOException ex) {
            throw new InputMismatchException();
          }

          if (this.numChars <= 0) {
            return EOF;
          }
        }

        return this.buf[this.curChar++];
      }
    }

    public int nextInt() {
      int c;
      for (c = this.read(); isSpaceChar(c); c = this.read()) {
      }

      byte sgn = 1;
      if (c == 45) {
        sgn = -1;
        c = this.read();
      }

      int res = 0;

      while (c >= 48 && c <= 57) {
        res *= 10;
        res += c - 48;
        c = this.read();
        if (isSpaceChar(c)) {
          return res * sgn;
        }
      }

      throw new InputMismatchException();
    }

    public static boolean isSpaceChar(int c) {
      return c == 32 || c == 10 || c == 13 || c == 9 || c == EOF;
    }

  }

  static interface FastIO {

  }
}