1.upto(n=gets.to_i){|j|puts (1..n).map{|i|"%3d".%1+(i+n/2+y=j-n-i*2)%n+y%n*n}*" "}