#include <bits/stdc++.h>
using namespace std;
int N;
int Triangle[305];
bool Use[305];
struct Element {
  int nodes[5], cnt;
} Sol[900005], Sol2[900005];
int K;
bool E[900005];
void Erase(int pos) {
  swap(Sol[pos], Sol[K]);
  --K;
}
void Insert(int pos, int v[], int cnt) {
  for (int i = 1; i <= cnt; i++) Sol[pos].nodes[i] = v[i];
  Sol[pos].cnt = cnt;
}
void SolveEven() {
  Sol[1].nodes[1] = 1;
  Sol[1].nodes[2] = 2;
  Sol[1].nodes[3] = 3;
  Sol[1].cnt = 3;
  Sol[2].nodes[1] = 1;
  Sol[2].nodes[2] = 2;
  Sol[2].nodes[3] = 4;
  Sol[2].cnt = 3;
  Sol[3].nodes[1] = 3;
  Sol[3].nodes[2] = 4;
  Sol[3].nodes[3] = 1;
  Sol[3].cnt = 3;
  Sol[4].nodes[1] = 3;
  Sol[4].nodes[2] = 4;
  Sol[4].nodes[3] = 2;
  Sol[4].cnt = 3;
  Triangle[1] = 3;
  Triangle[3] = 1;
  K = 4;
  for (int i = 5; i <= N; i += 2) {
    int a = i, b = i + 1;
    memset(Use, 0, sizeof(Use));
    memset(E, 0, sizeof(E));
    int init = K;
    for (int k = 1; k <= init; k++) {
      if (Sol[k].cnt == 3 && Use[Sol[k].nodes[1]] == 0) {
        int p = Sol[k].nodes[1], q = Sol[k].nodes[2], r = Sol[k].nodes[3];
        Use[Sol[k].nodes[1]] = 1;
        int v[] = {0, p, a, q, r};
        E[k] = 1;
        ++K;
        Insert(K, v, 4);
        ++K;
        v[4] = b;
        Insert(K, v, 4);
        ++K;
        int v2[] = {0, p, q, b, 0};
        Insert(K, v2, 3);
      }
    }
    for (int k = 1; k <= K; k++) {
      if (Sol[k].cnt == 4 && Sol[k].nodes[1] == 1 && Sol[k].nodes[2] == a &&
          Sol[k].nodes[3] == 2 && Sol[k].nodes[4] == b) {
        E[k] = 1;
        ++K;
        int v[] = {0, a, b, 1};
        Insert(K, v, 3);
        ++K;
        v[3] = 2;
        Insert(K, v, 3);
        break;
      }
    }
    int cnt = 0;
    for (int k = 1; k <= K; k++)
      if (E[k] == 0) Sol2[++cnt] = Sol[k];
    K = cnt;
    for (int k = 1; k <= K; k++) Sol[k] = Sol2[k];
  }
}
void SolveOdd() {
  Sol[1].nodes[1] = 2;
  Sol[1].nodes[2] = 3;
  Sol[1].nodes[3] = 1;
  Sol[1].cnt = 3;
  Sol[2].nodes[1] = 2;
  Sol[2].nodes[2] = 3;
  Sol[2].nodes[3] = 1;
  Sol[2].cnt = 3;
  K = 2;
  for (int i = 4; i <= N; i += 2) {
    int a = i, b = i + 1;
    memset(Use, 0, sizeof(Use));
    memset(E, 0, sizeof(E));
    int init = K;
    for (int k = 1; k <= init; k++) {
      if (Sol[k].cnt == 3 && Use[Sol[k].nodes[1]] == 0) {
        int p = Sol[k].nodes[1], q = Sol[k].nodes[2], r = Sol[k].nodes[3];
        Use[Sol[k].nodes[1]] = 1;
        int v[] = {0, p, a, q, r};
        E[k] = 1;
        ++K;
        Insert(K, v, 4);
        ++K;
        v[4] = b;
        Insert(K, v, 4);
        ++K;
        int v2[] = {0, p, q, b, 0};
        Insert(K, v2, 3);
      }
    }
    int v[] = {0, a, b, 1};
    ++K;
    Insert(K, v, 3);
    ++K;
    Insert(K, v, 3);
    int cnt = 0;
    for (int k = 1; k <= K; k++)
      if (E[k] == 0) Sol2[++cnt] = Sol[k];
    K = cnt;
    for (int k = 1; k <= K; k++) Sol[k] = Sol2[k];
  }
}
int main() {
  cin >> N;
  if (N % 2 == 0)
    SolveEven();
  else
    SolveOdd();
  printf("%d\n", K);
  for (int i = 1; i <= K; i++) {
    printf("%d ", Sol[i].cnt);
    for (int j = 1; j <= Sol[i].cnt; j++) printf("%d ", Sol[i].nodes[j]);
    printf("\n");
  }
  return 0;
}

### Prompt

Develop a solution in CPP to the problem described below:

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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int N;
int Triangle[305];
bool Use[305];
struct Element {
  int nodes[5], cnt;
} Sol[900005], Sol2[900005];
int K;
bool E[900005];
void Erase(int pos) {
  swap(Sol[pos], Sol[K]);
  --K;
}
void Insert(int pos, int v[], int cnt) {
  for (int i = 1; i <= cnt; i++) Sol[pos].nodes[i] = v[i];
  Sol[pos].cnt = cnt;
}
void SolveEven() {
  Sol[1].nodes[1] = 1;
  Sol[1].nodes[2] = 2;
  Sol[1].nodes[3] = 3;
  Sol[1].cnt = 3;
  Sol[2].nodes[1] = 1;
  Sol[2].nodes[2] = 2;
  Sol[2].nodes[3] = 4;
  Sol[2].cnt = 3;
  Sol[3].nodes[1] = 3;
  Sol[3].nodes[2] = 4;
  Sol[3].nodes[3] = 1;
  Sol[3].cnt = 3;
  Sol[4].nodes[1] = 3;
  Sol[4].nodes[2] = 4;
  Sol[4].nodes[3] = 2;
  Sol[4].cnt = 3;
  Triangle[1] = 3;
  Triangle[3] = 1;
  K = 4;
  for (int i = 5; i <= N; i += 2) {
    int a = i, b = i + 1;
    memset(Use, 0, sizeof(Use));
    memset(E, 0, sizeof(E));
    int init = K;
    for (int k = 1; k <= init; k++) {
      if (Sol[k].cnt == 3 && Use[Sol[k].nodes[1]] == 0) {
        int p = Sol[k].nodes[1], q = Sol[k].nodes[2], r = Sol[k].nodes[3];
        Use[Sol[k].nodes[1]] = 1;
        int v[] = {0, p, a, q, r};
        E[k] = 1;
        ++K;
        Insert(K, v, 4);
        ++K;
        v[4] = b;
        Insert(K, v, 4);
        ++K;
        int v2[] = {0, p, q, b, 0};
        Insert(K, v2, 3);
      }
    }
    for (int k = 1; k <= K; k++) {
      if (Sol[k].cnt == 4 && Sol[k].nodes[1] == 1 && Sol[k].nodes[2] == a &&
          Sol[k].nodes[3] == 2 && Sol[k].nodes[4] == b) {
        E[k] = 1;
        ++K;
        int v[] = {0, a, b, 1};
        Insert(K, v, 3);
        ++K;
        v[3] = 2;
        Insert(K, v, 3);
        break;
      }
    }
    int cnt = 0;
    for (int k = 1; k <= K; k++)
      if (E[k] == 0) Sol2[++cnt] = Sol[k];
    K = cnt;
    for (int k = 1; k <= K; k++) Sol[k] = Sol2[k];
  }
}
void SolveOdd() {
  Sol[1].nodes[1] = 2;
  Sol[1].nodes[2] = 3;
  Sol[1].nodes[3] = 1;
  Sol[1].cnt = 3;
  Sol[2].nodes[1] = 2;
  Sol[2].nodes[2] = 3;
  Sol[2].nodes[3] = 1;
  Sol[2].cnt = 3;
  K = 2;
  for (int i = 4; i <= N; i += 2) {
    int a = i, b = i + 1;
    memset(Use, 0, sizeof(Use));
    memset(E, 0, sizeof(E));
    int init = K;
    for (int k = 1; k <= init; k++) {
      if (Sol[k].cnt == 3 && Use[Sol[k].nodes[1]] == 0) {
        int p = Sol[k].nodes[1], q = Sol[k].nodes[2], r = Sol[k].nodes[3];
        Use[Sol[k].nodes[1]] = 1;
        int v[] = {0, p, a, q, r};
        E[k] = 1;
        ++K;
        Insert(K, v, 4);
        ++K;
        v[4] = b;
        Insert(K, v, 4);
        ++K;
        int v2[] = {0, p, q, b, 0};
        Insert(K, v2, 3);
      }
    }
    int v[] = {0, a, b, 1};
    ++K;
    Insert(K, v, 3);
    ++K;
    Insert(K, v, 3);
    int cnt = 0;
    for (int k = 1; k <= K; k++)
      if (E[k] == 0) Sol2[++cnt] = Sol[k];
    K = cnt;
    for (int k = 1; k <= K; k++) Sol[k] = Sol2[k];
  }
}
int main() {
  cin >> N;
  if (N % 2 == 0)
    SolveEven();
  else
    SolveOdd();
  printf("%d\n", K);
  for (int i = 1; i <= K; i++) {
    printf("%d ", Sol[i].cnt);
    for (int j = 1; j <= Sol[i].cnt; j++) printf("%d ", Sol[i].nodes[j]);
    printf("\n");
  }
  return 0;
}

```