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.*;
import java.util.*;

public class ProC {
	static StreamTokenizer in=new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
	static int nextInt() throws IOException    
	{  
	    in.nextToken();    
	    return (int)in.nval;     
	}
	static String next() throws IOException    
	{  
	    in.nextToken();  
	    return in.sval;
	}
	static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
	static int n,ct;
	static int[][] aa=new int[100][100];

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		n=in.nextInt();
		for(int i=1;i<=n/2;i++)
		for(int j=1;j<=n/2;j++)
		{
			if(ct==n*n/2+1-2*n+1) break;
			aa[i][j]=++ct;
			aa[i][n+1-j]=++ct;
			aa[n+1-i][j]=++ct;
			aa[n+1-i][n+1-j]=++ct;
		}
		for(int i=1;i<=n;i++)
		{
			aa[i][n/2+1]=++ct;
			if(i!=n/2+1) aa[n/2+1][i]=++ct;
		}
		ct=0;
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				if(aa[i][j]==0) System.out.print((++ct)*2);
				else System.out.print(aa[i][j]*2-1);
				System.out.print(" ");
			}
			System.out.println();
		}
	}
}