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.Scanner;

public class C{
	public static void main( String[] args ){
		Scanner scanner = new Scanner( System.in );
		int n = scanner.nextInt( );
		int[][] m = new int[n][n];
		for( int i = 0; i < n; ++i ){
			for( int j = 0; j < n; ++j ){
				m[i][j] = n * i + j + 1;
			}
		}

		for( int i = ( ( n + 1 >> 1 ) & 1 ); i < ( n >> 1 ); i += 2 ){
			int last = m[i + 1][i];
			for( int j = 0; j < ( n - 2 * i - 1 ) * 4; ++j ){
				int cur;
				if( j < n - 2 * i ){
					cur = m[i][i + j];
					m[i][i + j] = last;
				}else if( j < ( n - 2 * i ) * 2 - 1 ){
					j -= n - 2 * i;
					cur = m[i + j + 1][n - i - 1];
					m[i + j + 1][n - i - 1] = last;
					j += n - 2 * i;
				}else if( j < ( n - 2 * i ) * 3 - 2 ){
					j -= ( n - 2 * i ) * 2 - 1;
					cur = m[n - i - 1][n - i - j - 2];
					m[n - i - 1][n - i - j - 2] = last;
					j += ( n - 2 * i ) * 2 - 1;
				}else{
					j -= ( n - 2 * i ) * 3 - 2;
					cur = m[n - i - j - 2][i];
					m[n - i - j - 2][i] = last;
					j += ( n - 2 * i ) * 3 - 2;
				}
				last = cur;
			}
		}

		for( int i = 0; i < n; ++i ){
			for( int j = 0; j < n; ++j ){
				System.out.print( m[i][j] + " " );
			}
			System.out.println( );
		}
	}
}