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.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {
    /*private static class TreeInfo {
        private Map<String, Integer> counter = new TreeMap<>();

        {
            this.counter.put("txt", 0);
            this.counter.put("java", 0);
            this.counter.put("zip", 0);
            this.counter.put("rar", 0);
            this.counter.put("jpg", 0);
            this.counter.put("png", 0);
            this.counter.put("gif", 0);
        }

        public TreeInfo(String dirName) {
            File path = new File(dirName);
            File[] roots = path.listRoots();

            int i = 0;
            for (File root : roots) {
                System.out.println(i + ": " + root.getName());
                i++;
            }

//            walk(dirName);
        }

        private void walk(String dirName) {
            File path = new File(dirName);
            File[] listFiles = path.listFiles();

            if (listFiles == null) {
                return;
            }

            for (File file : listFiles) {
                String name = file.getName();

                if (file.isDirectory()) {
                    walk(name);
                } else {
                    Pattern pattern = Pattern.compile("\\.(txt|java|zip|rar|jpg|png|gif)$");
                    Matcher matcher = pattern.matcher(name);

                    if (matcher.find()) {
                        String konec = matcher.group(1);
                        counter.replace(konec, counter.get(konec) + 1);
                    }
                }
            }
        }

        @Override
        public String toString() {
            String result = "";
            for (Map.Entry<String, Integer> entry : counter.entrySet()) {
                result += entry.getKey() + " - " + entry.getValue() + "\n";
            }
            return result;
        }
    }*/

    public static void main(String[] args) throws FileNotFoundException, IOException {
        InputStream inputStream = System.in;
//        InputStream inputStream = new FileInputStream("dijkstra.in");
        OutputStream outputStream = System.out;
//        OutputStream outputStream = new FileOutputStream("dijkstra.out");
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Answer solver = new Answer();
        solver.solve(1, in, out);
        out.close();

        /*
        File path = new File(".");

        File[] listFiles = path.listFiles();

        Map<String, Integer> counter = new TreeMap<>();
        counter.put("txt", 0);
        counter.put("java", 0);
        counter.put("zip", 0);
        counter.put("rar", 0);
        counter.put("jpg", 0);
        counter.put("png", 0);
        counter.put("gif", 0);

        for (File file : listFiles) {
            String fileName = file.getName();
            int len = fileName.length();
            String konec = "";
            if (len >= 4) {
                konec = fileName.substring(len - 4);
            }

            if (counter.containsKey(konec)) {
                counter.replace(konec, counter.get(konec) + 1);
            }
        }

        for (Map.Entry<String, Integer> entry : counter.entrySet()) {
            System.out.println(entry.getKey() + " - " + entry.getValue());
        }*/

//        String[] list = path.list();
//                path.list(new FilenameFilter() {
//            @Override
//            public boolean accept(File dir, String name) {
//                return name.endsWith(".in");
//            }
//        });
//        Arrays.sort(list, String.CASE_INSENSITIVE_ORDER);
//        for (String s : list) {
//            System.out.println(s);
//        }
    }

    static class Answer {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();

            int[][] ans = new int[n][n];

            int a = 1;
            int x = 1;
            for (int i = 0; i <= n / 2; i++) {
                for (int j = n / 2 - i; j <= n / 2 + i; j++) {
                    ans[i][j] = a;
                    a += 2;
                }
                x++;
            }
            x -= 2;
            for (int i = n / 2 + 1; i < n; i++) {
                for (int j = n / 2 - x + 1; j < n / 2 + x; j++) {
                    ans[i][j] = a;
                    a += 2;
                }
                x--;
            }

            a = 2;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (ans[i][j] == 0) {
                        ans[i][j] = a;
                        a += 2;
                    }
                }
            }

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    out.print(ans[i][j] + " ");
                }
                out.println();
            }
        }
    }

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

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 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());
        }
    }
}