Problem: Egor wants to achieve a rating of 1600 points on the well-known chess portal ChessForces and he needs your help!

Before you start solving the problem, Egor wants to remind you how the chess pieces move. Chess rook moves along straight lines up and down, left and right, as many squares as it wants. And when it wants, it can stop. The queen walks in all directions vertically and diagonally at any distance. You can see the examples below.

<image>

To reach the goal, Egor should research the next topic:

There is an N × N board. Each cell of the board has a number from 1 to N ^ 2 in it and numbers in all cells are distinct.

In the beginning, some chess figure stands in the cell with the number 1. Note that this cell is already considered as visited. After that every move is determined by the following rules: 

  1. Among all not visited yet cells to which the figure can get in one move, it goes to the cell that has minimal number.
  2. If all accessible cells were already visited and some cells are not yet visited, then the figure is teleported to the not visited cell that has minimal number. If this step happens, the piece pays a fee of 1 vun.
  3. If all cells are already visited, the process is stopped. 



Egor should find an N × N board on which the rook pays strictly less vuns than the queen during the round with this numbering. Help him to find such N × N numbered board, or tell that it doesn't exist.

Input

The only line contains one integer N — the size of the board, 1≤ N ≤ 500.

Output

The output should contain N lines.

In i-th line output N numbers — numbers on the i-th row of the board. All numbers from 1 to N × N must be used exactly once.

On your board rook must pay strictly less vuns than the queen.

If there are no solutions, print -1.

If there are several solutions, you can output any of them. 

Examples

Input


1


Output


-1

Input


4


Output


4 3 6 12 
7 5 9 15 
14 1 11 10 
13 8 16 2 

Note

In case we have 1 × 1 board, both rook and queen do not have a chance to pay fees.

In second sample rook goes through cells 1 → 3 → 4 → 6 → 9 → 5 → 7 → 13 → 2 → 8 → 16 → 11 → 10 → 12 → 15 → (1 vun) → 14. 

Queen goes through 1 → 3 → 4 → 2 → 5 → 6 → 9 → 7 → 13 → 8 → 11 → 10 → 12 → 15 → (1 vun) → 14 → (1 vun) → 16.

As a result rook pays 1 vun and queen pays 2 vuns.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;


public class Solution {
    static void recurse(int arr[],int i,int n){
        if(i==n){
            //System.out.println(Arrays.toString(arr));
            if(solve(arr)){
                //System.out.println(Arrays.toString(arr));
            }
            return;
        }

        for(int j=i;j<n;j++){
            int t=arr[i];
            arr[i]=arr[j];
            arr[j]=t;
            recurse(arr,i+1,n);
            t=arr[i];
            arr[i]=arr[j];
            arr[j]=t;
        }
    }
    static boolean solve(int arr[]){
        int k=0;
        int mat[][]=new int[3][3];
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++)
                mat[i][j]=arr[k++];
        }

        int coina=rook(mat,false);
        int coinb=rook(mat,true);
        if(coina<coinb){
            //System.out.println(coina+" "+coinb);
           return true;
        }

        return false;

    }
    static int rook(int mat[][],boolean ok){
        int i,j,pos1=-1,pos2=-1;
        for(i=0;i<3;i++){
            for(j=0;j<3;j++){
                if(mat[i][j]==1){
                    pos1=i;
                    pos2=j;
                }
            }
        }

        boolean visited[][]=new boolean[3][3];
        visited[pos1][pos2]=true;
        int x=1;
        int coin=0;
        while(x<9){
            int a=-1,b=-1,dist=10,dist1=10,a1=-1,b1=-1;
            for(i=0;i<3;i++){
                for(j=0;j<3;j++){
                    if(!visited[i][j] ) {
                        if (((!ok && reach1(i, j, pos1, pos2))
                                || (ok && reach2(i, j, pos1, pos2)))) {
                            if (mat[i][j] < dist) {
                                a = i;
                                b = j;
                                dist = mat[i][j];
                            }
                        }
                        if(mat[i][j]<dist1){
                            a1=i;
                            b1=j;
                            dist1=mat[i][j];
                        }
                    }
                }
            }

            if(dist==10){
                coin++;
                pos1=a1;
                pos2=b1;
            }
            else{
                pos1=a;
                pos2=b;
            }
            visited[pos1][pos2]=true;
            x++;
        }

        return coin;
    }

    static boolean reach1(int i,int j,int pos1,int pos2){
        if(i==pos1 || j==pos2)
            return true;
        return false;
    }

    static boolean reach2(int i,int j,int pos1,int pos2){
        if(i==pos1 || j==pos2)
            return true;
        if(i-j==pos1-pos2)
            return true;
        if(i+j==pos1+pos2)
            return true;
        return false;
    }
    public static void main(String[] args) throws IOException {
        FastReader in=new FastReader(System.in);
        StringBuilder sb=new StringBuilder();
        int i, j;
        int n = in.nextInt();
        if(n<=2){
            System.out.println("-1");
        }
        else {
            int arr[][] = new int[n][n];
            int a, b;
            if (n % 2 == 0) {
                a = n - 1;
                b = n - 1;
            } else {
                a = 0;
                b = 0;
            }
            int x[]={1,2,4,5,3,8,9,6,7};
            int z=1,k=0,prea=a,preb=b,pre1a=a,pre1b=b;
            while((a>=0 && a<=n-4) ||  (b>=3 && b<=n-1)){
                arr[a][b]=z++;
                //System.out.println(a+" "+b+" "+z);
                if(b==0){
                    if(arr[a][b+1]==0)
                        b++;
                    else
                        a++;
                }
                else if(a==n-1){
                    if(arr[a-1][b]==0)
                        a--;
                    else
                        b--;
                }
                else if(a+b==(n-1)){
                    if(arr[a+1][b]==0){
                        a++;
                    }
                    else{
                        b--;
                    }
                }
                else{
                    if(a==prea){
                        if(b==preb-1)
                            b--;
                        else
                            b++;
                    }
                    else{
                        if(a==prea-1)
                            a--;
                        else
                            a++;
                    }
                }
                prea=pre1a;
                preb=pre1b;
                pre1a=a;
                pre1b=b;
            }
            for(i=n-3;i<n;i++){
                for(j=0;j<3;j++)
                    arr[i][j]=z+x[k++]-1;
            }
            for(i=0;i<n;i++){
                for(j=0;j<n;j++)
                    sb.append(arr[i][j]).append(" ");
                sb.append("\n");
            }
            System.out.print(sb);

        }



    }
}
class FastReader {

    byte[] buf = new byte[2048];
    int index, total;
    InputStream in;

    FastReader(InputStream is) {
        in = is;
    }

    int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    }

    String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan()) ;
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }

    int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }

    long nextLong() throws IOException {
        int c;
        long val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
}