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:
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		MyScanner sc = new MyScanner();
        int n = sc.nextInt();
        int[][] arr = new int[n+1][n+1];

        int start = n / 2 + 1;
        int end = start;
        int odd = 1;
        for (int i = 1; i <= n; ++i){
            for (int j = start; j <= end; ++j){
                arr[i][j] = odd;
                odd+=2;
            }
            if (i <= n / 2){
                start--;
                end++;
            }else{
                start++;
                end--;
            }
        }
        
        int even = 2;
        for (int i = 1; i <= n; ++i){
            for (int j = 1; j <= n; ++j){
                if (arr[i][j] == 0){
                    arr[i][j] = even;
                    even += 2;
                }
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }
	}
		    //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;
      
   //-----------MyScanner class for faster input----------
   public static class MyScanner {
      BufferedReader br;
      StringTokenizer st;
 
      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }
 
      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
 
      int nextInt() {
          return Integer.parseInt(next());
      }
 
      long nextLong() {
          return Long.parseLong(next());
      }
 
      double nextDouble() {
          return Double.parseDouble(next());
      }
 
      String nextLine(){
          String str = "";
      try {
         str = br.readLine();
      } catch (IOException e) {
         e.printStackTrace();
      }
      return str;
      }

   }
}