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.util.*;
import java.util.concurrent.LinkedBlockingQueue;
public class Main {

	public static void main(String[] args) {
		FastScanner sc=new FastScanner();
		PrintWriter pw=new PrintWriter(System.out);
		while(sc.hasNext()){
			int n=sc.nextInt();
			LinkedBlockingQueue<Integer>queue1=new LinkedBlockingQueue<Integer>();
			LinkedBlockingQueue<Integer>queue2=new LinkedBlockingQueue<Integer>();
			
			for(int i=1;i<=n*n;i++) {
				if(i%2==0)queue2.add(i);
				else queue1.add(i);
			}
			int[][]maze=new int[n+1][n+1];
			int mid=(n+1)/2;
			for(int i=1;i<=mid;i++){
				for(int j=mid+1-i;j<mid+1-i+2*i-1;j++){
					maze[i][j]=queue1.poll();
				}
			}
			for(int i=mid+1;i<=n;i++){
				for(int j=i-mid+1;j<i-mid+1+2*(n-i)+1;j++){
					maze[i][j]=queue1.poll();
				}
			}
			for(int i=1;i<=n;i++){
				for(int j=1;j<=n;j++){
					if(maze[i][j]==0)
						maze[i][j]=queue2.poll();
				}
			}
			for(int i=1;i<=n;i++){
				for(int j=1;j<=n;j++){
						pw.print(maze[i][j]+" ");
				}
				pw.println();
			}
			pw.flush();
		}

	}
}
class FastScanner {
    BufferedReader br;
    StringTokenizer st;
    public FastScanner() {
        try	{
            br = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer("");
        } catch (Exception e){e.printStackTrace();}
    }
    public boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String line = nextLine();
            if (line == null) {
                return false;
            }
            st= new StringTokenizer(line);
        }
        return true;
    }
    public String next() {
        if (st.hasMoreTokens())	return st.nextToken();
        try {st = new StringTokenizer(br.readLine());}
        catch (Exception e) {e.printStackTrace();}
        return st.nextToken();
    }

    public int nextInt() {return Integer.parseInt(next());}

    public long nextLong() {return Long.parseLong(next());}

    public double nextDouble() {return Double.parseDouble(next());}

    public String nextLine() {
        String line = "";
        try {line = br.readLine();}
        catch (Exception e) {e.printStackTrace();}
        return line;
    }
}