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:
/**
 * Created by ankeet on 8/22/16.
 */
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C710 {

    static FastReader in = null;
    static PrintWriter out = null;

    public static void solve()
    {
        int n = in.nint();
        int[][] mat = new int[n][n];
        int ct = 1;
        boolean up =true;
        for(int i=0; i<n; i++)
        {

            int spos = (n-ct)/2;
            int fpos =  n-1-spos;
            for(int j=spos; j<=fpos; j++) {
                mat[i][j] = 1;
            }
            if(ct == n)
            {
                up = false;
            }
            if(up) ct+=2;
            else ct-=2;
        }
        int odd = 1;
        int even = 2;
        for(int i=0; i<n; i++)
        {
            for(int j=0; j<n; j++)
            {
                if(mat[i][j] == 1)
                {
                    mat[i][j] = odd;
                    odd+=2;
                }
                else
                {
                    mat[i][j] = even;
                    even+=2;
                }

                out.print(mat[i][j]);
                if(j!=n-1) out.print(" ");
            }
            out.println();
        }
    }

    public static void main(String[] args)
    {
        in = new FastReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();

    }

    static class FastReader {

        BufferedReader read;
        StringTokenizer tokenizer;

        public FastReader(InputStream in)
        {
            read = new BufferedReader(new InputStreamReader(in));
        }

        public String next()
        {
            while(tokenizer == null || !tokenizer.hasMoreTokens())
            {
                try{
                    tokenizer = new StringTokenizer(read.readLine());
                }catch(Exception e){
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nint()
        {
            return Integer.parseInt(next());
        }
        public long nlong()
        {
            return Long.parseLong(next());
        }
        public double ndouble()
        {
            return Double.parseDouble(next());
        }

        public int[] narr(int n)
        {
            int[] a = new int[n];
            for(int i=0; i<n; ++i)
            {
                a[i] = nint();
            }
            return a;
        }

        public long[] nlarr(int n)
        {
            long[] a = new long[n];
            for(int i=0; i<n; ++i)
            {
                a[i] = nlong();
            }
            return a;
        }
    }


}