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 CodeForces {
    private final BufferedReader reader;
    private final PrintWriter writer;
    private StringTokenizer tokenizer;

    private void solve() {
        int n = nextInt();
        boolean[][] res = new boolean[n][n];
        int nextOdd = 1;
        int nextEven = 2;
        int mid = n / 2;
        for (int i = 0; i <= mid; i++) {
            for (int j = 0; j <= i; j++) {
                res[i][mid - j] = res[i][mid + j] = true;
                res[n - i - 1][mid - j] = res[n - i - 1][mid + j] = true;
            }
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (res[i][j]) {
                    writer.print(nextOdd + " ");
                    nextOdd += 2;
                } else {
                    writer.print(nextEven + " ");
                    nextEven += 2;
                }
            }
            writer.println();
        }
    }



    public static void main(String[] args) {
        new CodeForces(System.in, System.out);
    }

    private CodeForces(InputStream inputStream, OutputStream outputStream) {
        this.reader = new BufferedReader(new InputStreamReader(inputStream));
        this.writer = new PrintWriter(outputStream);
        solve();
        writer.close();
    }

    private String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(readLine());
        }
        return tokenizer.nextToken();
    }

    private String readLine() {
        String line;
        try {
            line = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return line;
    }

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

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

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

    private void shuffleArray(long[] a) {
        Random r = new Random();
        int tmp;
        for (int i = 1; i < a.length; i++) {
            tmp = r.nextInt(i + 1);
            long val = a[tmp];
            a[tmp] = a[i];
            a[i] = val;
        }
    }
}