Problem: In order to fly to the Moon Mister B just needs to solve the following problem.

There is a complete indirected graph with n vertices. You need to cover it with several simple cycles of length 3 and 4 so that each edge is in exactly 2 cycles.

We are sure that Mister B will solve the problem soon and will fly to the Moon. Will you?

Input

The only line contains single integer n (3 ≤ n ≤ 300).

Output

If there is no answer, print -1.

Otherwise, in the first line print k (1 ≤ k ≤ n2) — the number of cycles in your solution.

In each of the next k lines print description of one cycle in the following format: first print integer m (3 ≤ m ≤ 4) — the length of the cycle, then print m integers v1, v2, ..., vm (1 ≤ vi ≤ n) — the vertices in the cycle in the traverse order. Each edge should be in exactly two cycles.

Examples

Input

3


Output

2
3 1 2 3
3 1 2 3


Input

5


Output

6
3 5 4 2
3 3 1 5
4 4 5 2 3
4 4 3 2 1
3 4 2 1
3 3 1 5

Solution (in JAVA):

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public ArrayList<TaskE.Cycle> ss;

        public void solve(int nodes) {
            if (nodes == 3) {
                ss.add(new TaskE.Cycle(0, 1, 2));
                ss.add(new TaskE.Cycle(0, 1, 2));
                return;
            } else if (nodes == 4) {
                ss.add(new TaskE.Cycle(0, 1, 2));
                ss.add(new TaskE.Cycle(1, 2, 3));
                ss.add(new TaskE.Cycle(2, 3, 0));
                ss.add(new TaskE.Cycle(3, 0, 1));
                return;
            } else if (nodes == 5) {
                ss.add(new TaskE.Cycle(4, 3, 1));
                ss.add(new TaskE.Cycle(2, 0, 4));
                ss.add(new TaskE.Cycle(3, 4, 1, 2));
                ss.add(new TaskE.Cycle(3, 2, 1, 0));
                ss.add(new TaskE.Cycle(3, 1, 0));
                ss.add(new TaskE.Cycle(2, 0, 4));
                return;
            } else if (nodes == 6) {
                ss.add(new TaskE.Cycle(0, 2, 3, 5));
                ss.add(new TaskE.Cycle(0, 1, 3, 4));
                ss.add(new TaskE.Cycle(1, 2, 4, 5));
                ss.add(new TaskE.Cycle(0, 3, 2));
                ss.add(new TaskE.Cycle(0, 3, 5));
                ss.add(new TaskE.Cycle(1, 4, 3));
                ss.add(new TaskE.Cycle(1, 4, 0));
                ss.add(new TaskE.Cycle(2, 5, 1));
                ss.add(new TaskE.Cycle(2, 5, 4));
                return;
            }
        }

        public void solve2(int nodes, int offset) {
            if (nodes % 2 == 0) {
                for (int a = 0; a < 4; a += 2) {
                    for (int b = 0; b < nodes; b += 2) {
                        ss.add(new TaskE.Cycle(b, offset + a, b + 1, offset + a + 1));
                        ss.add(new TaskE.Cycle(b, offset + a, b + 1, offset + a + 1));
                    }
                }
                return;
            } else {
                for (int b = 0; b < 4; b += 2) {
                    for (int a = 0; a < nodes; a++) {
                        ss.add(new TaskE.Cycle(a, offset + b, (a + 1) % nodes, offset + b + 1));
                    }
                }
                return;
            }
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int x = n % 4;
            if (x <= 2) x += 4;
            ss = new ArrayList<>();
            for (int j = x; j < n; j += 4) {
                ss.add(new TaskE.Cycle(j, j + 1, j + 2));
                ss.add(new TaskE.Cycle(j + 1, j + 2, j + 3));
                ss.add(new TaskE.Cycle(j + 2, j + 3, j));
                ss.add(new TaskE.Cycle(j + 3, j, j + 1));
            }
            solve(x);
            for (int j = x; j < n; j += 4) {
                for (int k = j + 4; k < n; k += 4) {
                    ss.add(new TaskE.Cycle(j, k, j + 1, k + 1));
                    ss.add(new TaskE.Cycle(j, k + 2, j + 1, k + 3));
                    ss.add(new TaskE.Cycle(j + 2, k, j + 3, k + 1));
                    ss.add(new TaskE.Cycle(j + 2, k + 2, j + 3, k + 3));
                    ss.add(new TaskE.Cycle(j, k, j + 1, k + 1));
                    ss.add(new TaskE.Cycle(j, k + 2, j + 1, k + 3));
                    ss.add(new TaskE.Cycle(j + 2, k, j + 3, k + 1));
                    ss.add(new TaskE.Cycle(j + 2, k + 2, j + 3, k + 3));
                }
                solve2(x, j);
            }

            out.println(ss.size());
            for (TaskE.Cycle c : ss) out.println(c);
        }

        static class Cycle {
            public ArrayList<Integer> r;

            public Cycle(int... a) {
                r = new ArrayList<>();
                for (int x : a) r.add(x);
            }

            public String toString() {
                StringBuilder s = new StringBuilder();
                s.append(r.size());
                for (int x : r) {
                    s.append(" " + (x + 1));
                }
                return s.toString();
            }

        }

    }

    static 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 println(Object... objects) {
            print(objects);
            writer.println();
        }

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

        public void println(int i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (this.numChars == -1) {
                throw new InputMismatchException();
            } else {
                if (this.curChar >= this.numChars) {
                    this.curChar = 0;

                    try {
                        this.numChars = this.stream.read(this.buf);
                    } catch (IOException var2) {
                        throw new InputMismatchException();
                    }

                    if (this.numChars <= 0) {
                        return -1;
                    }
                }

                return this.buf[this.curChar++];
            }
        }

        public int nextInt() {
            int c;
            for (c = this.read(); isSpaceChar(c); c = this.read()) {
                ;
            }

            byte sgn = 1;
            if (c == 45) {
                sgn = -1;
                c = this.read();
            }

            int res = 0;

            while (c >= 48 && c <= 57) {
                res *= 10;
                res += c - 48;
                c = this.read();
                if (isSpaceChar(c)) {
                    return res * sgn;
                }
            }

            throw new InputMismatchException();
        }

        public static boolean isSpaceChar(int c) {
            return c == 32 || c == 10 || c == 13 || c == 9 || c == -1;
        }

    }
}