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.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.PriorityQueue;

public class magicoddsquare {

	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter w = new PrintWriter(System.out);

        int n = Integer.parseInt(r.readLine());
        
        PriorityQueue<Integer> odd = new PriorityQueue<Integer>();
        PriorityQueue<Integer> even = new PriorityQueue<Integer>();
        
        for (int i = 1; i <= n * n; i++) {
        	if (i % 2 == 1) {
        		odd.add(i);
        	} else even.add(i);
        }
        
        for (int i = 0; i < n / 2; i++) {
        	for (int j = 0; j < (n / 2) - i; j++) {
        		w.print(even.remove() + " ");
        	}
        	for (int j = 0; j < 2 * i + 1; j++) {
        		w.print(odd.remove() + " ");
        	}
        	for (int j = 0; j < (n / 2) - i; j++) {
        		w.print(even.remove() + " ");
        	}
        	w.println();
        }
        
        for (int i = 0; i < n; i++) {
        	w.print(odd.remove() + " ");
        }
        w.println();
        
        for (int i = n/2 - 1; i >= 0; i--) {
        	for (int j = 0; j < (n / 2) - i; j++) {
        		w.print(even.remove() + " ");
        	}
        	for (int j = 0; j < 2 * i + 1; j++) {
        		w.print(odd.remove() + " ");
        	}
        	for (int j = 0; j < (n / 2) - i; j++) {
        		w.print(even.remove() + " ");
        	}
        	w.println();
        }
        
        w.flush();
	}

}