Problem: Gerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one bag has two candies, one bag has three candies and so on. In fact, for each integer k from 1 to n2 he has exactly one bag with k candies. 

Help him give n bags of candies to each brother so that all brothers got the same number of candies.

Input

The single line contains a single integer n (n is even, 2 ≤ n ≤ 100) — the number of Gerald's brothers.

Output

Let's assume that Gerald indexes his brothers with numbers from 1 to n. You need to print n lines, on the i-th line print n integers — the numbers of candies in the bags for the i-th brother. Naturally, all these numbers should be distinct and be within limits from 1 to n2. You can print the numbers in the lines in any order. 

It is guaranteed that the solution exists at the given limits.

Examples

Input

2


Output

1 4
2 3

Note

The sample shows Gerald's actions if he has two brothers. In this case, his bags contain 1, 2, 3 and 4 candies. He can give the bags with 1 and 4 candies to one brother and the bags with 2 and 3 to the other brother.

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.InputMismatchException;

/**
 * @author pvasilyev
 * @since 7/27/13
 */
public class ProblemA {
    public static final String FILE_IN = "std.in";
    public static final String FILE_OUT = "std.out";
    private static boolean debugMode = true;

    public static void main(String[] args) throws IOException {

        final BufferedInputStream reader = new BufferedInputStream((debugMode ? System.in : new FileInputStream(FILE_IN)));
        final PrintWriter writer = new PrintWriter(debugMode ? System.out : new FileOutputStream(FILE_OUT));

        solveTheProblem(reader, writer);

        reader.close();
        writer.close();
    }

    private static void solveTheProblem(final BufferedInputStream reader, final PrintWriter writer) throws IOException {
        InputReader r = new InputReader(reader);
        final int n = r.readInt();
        int[][] square = new int[n][n];

        int k = 0;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                square[i][j] = ++k;
            }
        }

        if (n == 2) {
            writer.println("1 4");
            writer.println("2 3");
            return;
        }
        if (n / 2 % 2 == 0) {
            int reducedSize = n/2;
            int[][] marks = new int[reducedSize][reducedSize];
            int seed = (n)/4;
            for (int i = 0; i < reducedSize; ++i) {
                for (int j = i; j < i+seed; ++j) {
                    marks[i][j%reducedSize] = 1;

                }
            }
            for (int i = 0; i < reducedSize; ++i) {
                for (int j = 0; j < reducedSize; ++j) {
                    if (marks[i][j] == 1) {
                        int tmp = square[i][j];
                        square[i][j] = square[n - i - 1][n - j - 1];
                        square[n - i - 1][n - j - 1] = tmp;

                        tmp = square[n-i-1][j];
                        square[n-1-i][j] = square[i][n-j-1];
                        square[i][n-j-1] = tmp;
                    }
                }
            }


        } else {
            int reducedSize = n/2;
            int[][] marks = new int[reducedSize][reducedSize];
            int seed = (n-2)/4;
            for (int i = 0; i < reducedSize; ++i) {
                for (int j = i; j < i+seed; ++j) {
                    marks[i][j%reducedSize] = 1;
                }
            }
            int start2 = seed;
            start2 = start2 == reducedSize ? 0 : start2;
            for (int i = 0; i < reducedSize; ++i) {
                marks[i][start2] = 2;
                if (++start2 == reducedSize) {
                    start2 = 0;
                    if (i == reducedSize - 1) {
                        start2++;
                    }
                }
            }
            int start3 = seed+1;
            start3 = start3 == reducedSize ? 0 : start3;
            for (int i = 0; i < reducedSize; ++i) {
                marks[i][start3] = 3;
                if (++start3 == reducedSize) {
                    start3 = 0;
                }
                if (i == reducedSize - 1) {
                    start2++;
                }
            }
            for (int i = 0; i < reducedSize; ++i) {
                for (int j = 0; j < reducedSize; ++j) {
                    if (marks[i][j] == 1) {
                        int tmp = square[i][j];
                        square[i][j] = square[n - i - 1][n - j - 1];
                        square[n - i - 1][n - j - 1] = tmp;

                        tmp = square[n-i-1][j];
                        square[n-1-i][j] = square[i][n-j-1];
                        square[i][n-j-1] = tmp;
                    } else if (marks[i][j] == 2) {
                        int tmp = square[i][j];
                        square[i][j] = square[n - i - 1][j];
                        square[n - i - 1][j] = tmp;

                    } else if (marks[i][j] == 3) {
                        int tmp = square[i][j];
                        square[i][j] = square[i][n - j - 1];
                        square[i][n - j - 1] = tmp;

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

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(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 int readInt() {
        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 boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.readInt();
        return array;
    }

}

class ArrayUtils {

    public static long sumArray(int[] array) {
        long result = 0;
        for (int element : array)
            result += element;
        return result;
    }

}