import java.io.*;
import java.util.*;

public class Main
{
   public static void main(String[] args) throws IOException {
     Scanner in = new Scanner(new FileReader("F.in"));
     PrintWriter out = new PrintWriter(new FileWriter("F.out"),true);
int n=in.nextInt();
int a[][]=new int[n][n];
int x=(n+1)/2,y=(n+1)/2;
int j=0,mx=1,my=1,ax=0,ay=0;
a[x-1][y-1]=1;
for(int i=2;i<=n*n;i++){
    switch(j){
        case 0: ++y;++ay; a[x-1][y-1]=i;break;
        case 1: --x;++ax; a[x-1][y-1]=i;break;
        case 2: --y;++ay; a[x-1][y-1]=i;break;
        case 3: ++x;++ax; a[x-1][y-1]=i;break;
        }
    
    if(mx==ax) {++j;if(j>3) j=0;++mx;ax=0;}
    if(my==ay) {++j;if(j>3) j=0;++my;ay=0;}
    }

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