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:
/*
 * Code Author: Akshay Miterani
 * DA-IICT
 */
import java.io.*;

import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
public class MainB {

	static double eps=(double)1e-6;
	static long mod=(int)1e9+7;
	public static void main(String args[]){
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		//----------My Code----------
		int n=in.nextInt();
		ArrayList<Integer> evens=new ArrayList<Integer>();
		ArrayList<Integer> odds=new ArrayList<Integer>();
		for(int i=1;i<=n*n;i++){
			if((i)%2==1){
				odds.add(i);
			}
			else{
				evens.add(i);
			}
		}
		int mat[][]=new int[n][n];
		int allow=n/2;
		int change=1;
		for(int i=0;i<n;i+=1){
			for(int j=0;j<n;j+=1){
				if(Math.min(j, n-j-1)<allow){
					mat[i][j]=evens.remove(evens.size()-1);
				}
				else{
					mat[i][j]=odds.remove(odds.size()-1);					
				}
			}
			if(allow==0)
				change*=-1;
			allow-=change;
		}
		for(int i=0;i<n;i+=1){
			for(int j=0;j<n;j+=1){
				out.print(mat[i][j]+" ");
			}
			out.println();
		}
		out.close();
		//---------------The End------------------

	}
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
	static class Pair implements Comparable<Pair>{
		int x;
		int y;
		int i;
		Pair(int xx,int yy){
			x=xx;
			y=yy;
		}
		@Override
		public int compareTo(Pair o) {
			return Integer.compare(this.x, o.x);
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}

		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		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 long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}