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.*;

public class Main {
    IOS ios;
    public static void main(String[] args) throws Exception {
        (new Main()).main();
    }

    void main() throws Exception {
        //ios = new IOS("main.in","");
        ios = new IOS("","");
        run();
        ios.close();
    }

    void run() throws Exception {
        ios.get();
            int n = ios.Int();
        int x = n >> 1, y = n >> 1, o = 2, e = 1;
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < n; ++j) {
                    if (i == x || j == y) {
                        ios.w(e + " "); e += 2;
                    } else {
                        int w = Math.abs(i - x), h = Math.abs(j - y);
                        if (w >= h) {
                            ios.w(o + " "); o += 2;
                        } else {
                            ios.w(e + " "); e += 2;
                        }
                    }
                }
                ios.w("\n");
            }
    }

}

class IOS {
    BufferedReader  inp;
    BufferedWriter  out;
    IOS(String Inp, String Out) throws Exception {
        inp = new BufferedReader(Inp != "" ? (new FileReader(Inp)) : (new InputStreamReader(System.in)));
        out = new BufferedWriter(Out != "" ? (new FileWriter(Out)) : (new OutputStreamWriter(System.out)));
    }
    void close() throws Exception {
        out.flush(); inp.close(); out.close();
    }
    StringTokenizer i;
    void    get() throws Exception {i = new StringTokenizer(str());}
    String  str() throws Exception {return inp.readLine();}
    int     Int() throws Exception {return Integer.parseInt(i.nextToken());}
    long    Long() throws Exception {return Long.parseLong(i.nextToken());}
    String  word() throws Exception {return i.nextToken();}
    void    w(String s) throws Exception {out.write(s);}

    long gcd(long u, long v) {
        long w = 0;
        while (u > 0) {
            w = u;
            u = v % u;
            v = w;
        }
        return v;
    }
}