import java.util.Scanner;
public class Arrayexer { //回文数
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int number = 0;
int arr[][] = new int[n][n];
for(int count = n-1,k = 0;count >= 0;count-=2,k++) {
number++;
arr[k][k] = number;
int i = k,j = k;
for(int h=1;h<=count;h++) {
j++;
number++;
arr[i][j] = number;
}
for(int h = 1;h<=count;h++) {
i++;
number++;
arr[i][j] = number;
}
for(int h = 1;h<=count;h++) {
j--;
number++;
arr[i][j] = number;
}
for(int h = 1;h<=count-1;h++) {
i--;
number++;
arr[i][j] = number;
}
}
for(int i=0;i<n;i++) {
for(int j=0;j<n;j++) {
System.out.print(arr[i][j]+"\t");
}
System.out.print("\n");
}
}
}