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.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;


// the difference (in each row/column/main diagonal)
// between the number of odds and the number of evens should be an odd number.
/*
0    1    0
1    1    1
0    1    0

.    .    1    .    .
.    1    1    1    .
1    1    1    1    1
.    1    1    1    .
.    .    1    .    .


.    .    .    1    .    .    .
.    .    1    1    1    .    .
.    1    1    1    1    1    .
1    1    1    1    1    1    1
.    1    1    1    1    1    .
.    .    1    1    1    .    .
.    .    .    1    .    .    .


7*7 = 49
upper(49/2) = 25
*/


public class C {

    static void solve(int N) throws IOException {
        int [][] M = new int[N][N];
        int begC = N/2;
        int endC = N/2;
        int currOdd = 1;
        boolean increase = true;
        for(int r=0; r<N; r++) {

            for(int c=begC; c<=endC; c++) {
            	//System.out.println("r: " + r + " c: " + c);
                M[r][c] = currOdd;
                currOdd += 2;
            } 
			if(begC == 0) {
			    increase = false;
			}
			
            if(increase) {
                begC -= 1;
                endC += 1;
            } else {
                begC += 1;
                endC -= 1;
            }

        }

        int currEven = 2;
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        for(int r=0; r<N; r++) {
            for(int c=0; c<N; c++) {
                if(M[r][c] == 0)  {
                    M[r][c] = currEven;
                    currEven += 2;
                }

                if(c > 0) {
                    bw.write(" " + M[r][c]);
                } else {
                    bw.write("" + M[r][c]);
                }
            }
            bw.newLine();
        }
        
        bw.close();
    }
    
    public static void main(String [] args) throws IOException { 
    	
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	int N = Integer.parseInt(br.readLine());
    	
    	solve(N);
    }
    
}