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.*;
import java.util.*;
import java.math.*;
import java.lang.*;
 
import static java.lang.Math.*;
 
/*
    Once a legend said : "Tries matlab string manipulation...for other info, go to page number 352 of the book."
*/

public class Main implements Runnable {
    boolean isRookMoveable(int x1, int y1, int x2, int y2) {
        return x1 == x2 || y1 == y2; 
    }
    boolean isQueenMoveable(int x1, int y1, int x2, int y2) {
        return isRookMoveable(x1, y1, x2, y2) || ((x1 + y1) == (x2 + y2)) || ((x1 - y1) == (x2 - y2));
    }
    void dfsRook(int i, int j) {
        vis[i][j] = 1;

        int minVal = Integer.MAX_VALUE;
        int minX = -1, minY = -1;
        for(int k = 0; k < 3; ++k) {
            for(int l = 0; l < 3; ++l) {
                if(isRookMoveable(i, j, k, l) && vis[k][l] == 0) {
                    if(tmat[k][l] < minVal) {
                        minVal = tmat[k][l];
                        minX = k;
                        minY = l;
                    }
                }
            }
        }

        if(minX == -1) {
            return;
        }
        dfsRook(minX, minY);
    }
    void dfsQueen(int i, int j) {
        vis[i][j] = 1;

        int minVal = Integer.MAX_VALUE;
        int minX = -1, minY = -1;
        for(int k = 0; k < 3; ++k) {
            for(int l = 0; l < 3; ++l) {
                if(isQueenMoveable(i, j, k, l) && vis[k][l] == 0) {
                    if(tmat[k][l] < minVal) {
                        minVal = tmat[k][l];
                        minX = k;
                        minY = l;
                    }
                }
            }
        }

        if(minX == -1) {
            return;
        }
        dfsQueen(minX, minY);
    }
    int vis[][];
    void create(int level) {
        if(level == 9) {
            int sx = -1, sy = -1;
            for(int i = 0; i < 3; ++i) {
                for(int j = 0; j < 3; ++j) {
                    if(tmat[i][j] == 1) {
                        sx = i;
                        sy = j;
                    }
                }
            }

            vis = new int[3][3];
            dfsRook(sx, sy);
            int cflag = 0;
            for(int i = 0; i < 3; ++i) {
                for(int j = 0; j < 3; ++j) {
                    if(vis[i][j] == 0)
                        cflag = 1;
                }
            }

            if(cflag == 1)
                return;

            vis = new int[3][3];
            dfsQueen(sx, sy);
            cflag = 0;
            for(int i = 0; i < 3; ++i) {
                for(int j = 0; j < 3; ++j) {
                    if(vis[i][j] == 0)
                        cflag = 1;
                }
            }

            if(cflag == 0)
                return;

            done = 1;
            return;
        }

        int x = level / 3;
        int y = level % 3;
        for(int i = 1; i <= 9; ++i) {
            if(flag[i] == 0) {
                tmat[x][y] = i;
                flag[i] = 1;
                create(level + 1);
                flag[i] = 0;
                if(done == 1)
                    return;
            }
        }
    }
    int tmat[][];
    int flag[];
    int done;
    public void run() {
        Maruti800 sc = new Maruti800(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        int n = sc.nextInt();
         
        int mat[][] = {{4, 3, 6, 12},  {7, 5, 9, 15}, {14, 1, 11, 10},  {13, 8, 16, 2}};

        if(n < 3)
            out.print("-1");
        else if(n == 3) {
            tmat = new int[3][3];
            flag = new int[10];
            done = 0;
            create(0);

            for(int i = 0; i < 3; ++i) {
                for(int j = 0; j < 3; ++j)
                    out.print(tmat[i][j] + " ");
                out.println();
            }
        }
        else if(n == 4) {
            for(int i = 0; i < 4; ++i) {
                for(int j = 0; j < 4; ++j)
                    out.print(mat[i][j] + " ");
                out.println();
            }
        }
        else {
            int newMat[][] = new int[n][n];
            int curVal = 1;
            for(int i = 0; i < 4; ++i) {
                for(int j = 0; j < n - 4; ++j) {
                    if(i % 2 == 1)
                        newMat[i][j + 4] = curVal++;
                    else
                        newMat[i][n - 1 - j] = curVal++;
                }
            }
            for(int i = 4; i < n; ++i) {
                for(int j = 0; j < n; ++j) {
                    if(i % 2 == 1)
                        newMat[i][j] = curVal++;
                    else
                        newMat[i][n - 1 - j] = curVal++;
                }
            }
            curVal--;
            if(n % 2 == 1) {
                int temp = newMat[n - 1][0];
                newMat[n - 1][0] = newMat[n - 1][1];
                newMat[n - 1][1] = temp;
            }
            else {
                int temp = newMat[n - 1][n - 1];
                newMat[n - 1][n - 1] = newMat[n - 1][1];
                newMat[n - 1][1] = temp;
            }
            for(int i = 0; i < 4; ++i) {
                for(int j = 0; j < 4; ++j)
                    newMat[i][j] = curVal + mat[i][j];
            }

            for(int i = 0; i < n; ++i) {
                for(int j = 0; j < n; ++j) {
                    out.print(newMat[i][j] + " ");
                }
                out.println();
            }
        }
        
        out.close();
    }
    static class Maruti800 {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        public Maruti800(InputStream stream) {
            this.stream = stream;
        }
        
        public int read() {
            if (numChars==-1) 
                throw new InputMismatchException();
            
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }
                
                if(numChars <= 0)               
                    return -1;
            }
            return buf[curChar++];
        }
     
        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();
            
            while(isSpaceChar(c)) 
                c = read();
            
            int sgn = 1;
            
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            
            int res = 0;
            do {
                if(c<'0'||c>'9') 
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c)); 
            
            return res * sgn;
        }
        
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }
        
        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        
        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } 
            while (!isSpaceChar(c));
            
            return res.toString();
        }
     
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
     
        public String next() {
            return readString();
        }
        
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main(),"Main",1<<26).start();
    }
}