
import java.io.*;
import java.util.*;
class Main{
	static int N;
	
 
	public static void main(String [] args){
		try {
		Scanner sc= new Scanner(new FileReader("F.in"));
		PrintWriter out = new PrintWriter (new FileWriter ("F.out"));

		N= sc.nextInt();
			int a[][]= new int[N][N];
			
			int p = 1;
			int m = N-1, n = 0;
			int temp=N*N;
			for (int i=N*N; i>=0; i--) {
				
				for (int k=m; k>=p; k--){
					a[m][k]=temp; temp--;
				}
				
				for (int l=m; l>=p;l--){
					a[l][n]=temp; temp--;
				}
				
				for (int j=(p-1); j<m; j++ ){
					a[n][j] = temp; temp--;
				}
				
				for (int q=(p-1); q<m; q++ ){
					a[q][m] = temp; temp--;
				}
				
				p++;
				m--; n++;
			}
a[N/2][N/2]=1;
for (int i=0; i<N; i++){
	for (int j=0;j<N; j++)
		out.print(a[i][j]+" ");
	out.println();
}
			sc.close();
	
	out.close();
	} catch (Exception e){}
	}

}