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.math.BigInteger;
import java.util.*;
public class edu16C{
public static long mod = 1000000007;
public static int map[][];
public static int dx[] = {0,1,1,1,0,-1,-1,-1};
public static int dy[] = {-1,-1,0,1,1,1,0,-1};
public static void main(String args[]) throws IOException{
BufferedReader lector = new BufferedReader(new InputStreamReader(System.in));
//String t[] = lector.readLine().split(" ");
int a = Integer.parseInt(lector.readLine());
StringBuilder sb = new StringBuilder("");
int ta[][] = new int[a][a];
int p =(a*a+1)/2-a-a+1;
for(int n = 0;n<a;n++){
ta[n][a/2]=1;
ta[a/2][n]=1;
}
int nn = 1;
while(p>0){
for(int n = 0;n<nn;n++){
ta[a/2+nn][a/2+n+1]=1;
ta[a/2+nn][a/2-n-1]=1;
ta[a/2-nn][a/2+n+1]=1;
ta[a/2-nn][a/2-n-1]=1;
p-=4;
}
nn++;
}
int ne = 2;
int no = 1;
/*int sum[][] = new int[a][2];
for(int n = 0;n<a;n++)
for(int m = 0;m<a;m++){
sum[n][0]=(sum[n][0]+ta[n][m])%2;
sum[m][1]=(sum[m][1]+ta[n][m])%2;
}
for(int n =0;n<a;n++)
if(sum[n][0]==0 || sum[n][1]==0)System.out.println("eeeeeeeeerror");
*/
for(int n =0;n<a;n++)
for(int m =0;m<a;m++)
System.out.print((ta[n][m]==1?(no+=2)-2:(ne+=2)-2)+(m==a-1?"\n":" "));
}
}
class p implements Comparable{
int a,b;
public p(int a,int b){
this.a = a;
this.b = b;
}
public int compareTo(Object o){
p pp = (p)o;
return (int)Math.signum(this.a-pp.a);
}
}