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.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;


import java.util.StringTokenizer;


 public class Test
 {
    
    static PrintWriter pw = new PrintWriter(System.out);
 
    public static void main(String[] args)throws Exception
    {
        Reader.init(System.in);
        int n = Reader.nextInt();
        StringBuilder res = new StringBuilder();
        ArrayList<Integer> odds = new ArrayList();
        ArrayList<Integer> evens = new ArrayList();
        int[][] ar = new int[n][n];
        
        for(int i = 1 ; i<= n * n ; i++)
            if(i%2  == 0)
                evens.add(i);
            else
                odds.add(i);
        
        Iterator<Integer> itr1 = odds.iterator();
        Iterator<Integer> itr2 = evens.iterator();

        if(n == 1)
        {
            pw.print(1);
            pw.close();
            return;
        }
        
        ar[0][n/2] = itr1.next();
        ar[n-1][n/2] = itr1.next();
        
        for(int j = 0 ; j<n; j++)
            ar[n/2][j] = itr1.next();
        
        int z = n - 2;
        for(int i = 1 ; i<n-1 ;i++)
        {
            if(i==n/2)
            {
                z += 2;
                continue;
            }
            
            int j = n/2;
            ar[i][j] = itr1.next();
            int q = 1;
            int count = 1;
            
            while(count<z)
            {
                ar[i][j+q]  = itr1.next();
                ar[i][j-q] = itr1.next();
                count += 2;
                q++;
            }
            
            if(i<n/2)
                z -= 2;
            else
                z+=2;
        }
        
        for(int i = 0 ; i<n; i++)
        {
            for(int j =0 ; j<n ; j++)
                if(ar[i][j] != 0)
                    res.append(ar[i][j]).append(" ");
                else
                    res.append(itr2.next()).append(" ");
            
            res.append("\n");
        }
        
        pw.print(res);
        pw.close();
    }
        
}

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    public static int pars(String x) {
        int num = 0;
        int i = 0;
        if (x.charAt(0) == '-') {
            i = 1;
        }
        for (; i < x.length(); i++) {
            num = num * 10 + (x.charAt(i) - '0');
        }

        if (x.charAt(0) == '-') {
            return -num;
        }

        return num;
    }

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    static void init(FileReader input) {
        reader = new BufferedReader(input);
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return pars(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
}