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.text.*;
import java.util.*;
import java.math.*;
import java.lang.*;

public class cfa {
	public static void main(String[] args) throws Exception {
		FastScanner f = new FastScanner();
		int n = f.nextInt();
		int[][] arr = new int[n][n];
		for(int i = 0; i < n; i++)
		{
			Arrays.fill(arr[i],1);
		}
		for(int i = 0; i < n/2; i++)
		{
			for(int j = 0; j < n/2 - i; j++)
			{
				arr[i][j] = 0;
				arr[i][n-j-1] = 0;
				arr[n-i-1][j] = 0;
				arr[n-i-1][n-j-1] = 0;
			}
		}
		Stack<Integer> odds = new Stack<Integer>();
		Stack<Integer> evens = new Stack<Integer>();
		for(int i = 1; i <= n*n; i++)
		{
			if(i % 2 == 1) odds.add(i);
			else evens.add(i);
		}
		for(int i = 0; i < n; i++)
		{
			for(int j = 0; j < n; j++)
			{
				if(arr[i][j] == 1)
				{
					arr[i][j] = odds.pop();
				}
				else 
				{
					arr[i][j] = evens.pop();
				}
			}
		}
		for(int i = 0; i < n; i++)
		{
			for(int j = 0; j < n; j++)
			{
				System.out.print(arr[i][j] + " ");
			}
			System.out.println();
		}
	}
	
    static class FastScanner {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public FastScanner() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
        	return Long.parseLong(next());
        }
        public double nextDouble() {
        	return Double.parseDouble(next());
        }

    }
}