#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const int oo = 0x3f3f3f3f;
const long long linf = 1ll << 60;
const double dinf = 1e60;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
template <typename T1, typename T2, typename T3, typename T4>
void scf(T1 &x, T2 &y, T3 &z, T4 &w) {
  scf(x);
  scf(y);
  scf(z);
  return scf(w);
}
inline char mygetchar() {
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
template <typename T>
inline bool chkmax(T &x, const T &y) {
  return y > x ? x = y, 1 : 0;
}
template <typename T>
inline bool chkmin(T &x, const T &y) {
  return y < x ? x = y, 1 : 0;
}
const int maxn = 310;
int n;
vector<vector<int> > ans;
vector<int> tmp;
int g[maxn][maxn];
void link(int u, int v) {
  if (u < v) swap(u, v);
  if (!g[u][v]) assert(0);
  --g[u][v];
}
void push() {
  ans.push_back(tmp);
  return;
}
namespace fuck0 {
void solve(int a, int b, int c, int d) {
  tmp = {a, b, c, d};
  push();
  tmp = {a, b, d, c};
  push();
  tmp = {a, d, b, c};
  push();
  return;
}
void solve(int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4) {
  tmp = {a1, b1, a2, b2};
  push();
  push();
  tmp = {a3, b3, a4, b4};
  push();
  push();
  tmp = {a1, b3, a2, b4};
  push();
  push();
  tmp = {a3, b1, a4, b2};
  push();
  push();
  return;
}
void solve() {
  for (int i = 1; i + 3 <= n; i += 4) {
    solve(i, i + 1, i + 2, i + 3);
    for (int j = i + 4; j + 3 <= n; j += 4)
      solve(i, i + 1, i + 2, i + 3, j, j + 1, j + 2, j + 3);
  }
  return;
}
}  // namespace fuck0
namespace fuck3 {
int x, y, z;
void solve(int a, int b) {
  tmp = {a, x, b, y};
  push();
  tmp = {a, x, b, z};
  push();
  tmp = {a, y, b, z};
  push();
  return;
}
void solve() {
  fuck0::solve();
  x = n - 2, y = n - 1, z = n;
  ;
  ;
  tmp = {x, y, z};
  push();
  push();
  for (int i = 1; i + 3 <= n; i += 4) solve(i, i + 1), solve(i + 2, i + 3);
  return;
}
}  // namespace fuck3
namespace fuck2 {
int x, y;
void solve(int a, int b) {
  tmp = {x, a, y, b};
  push();
  push();
  return;
}
void solve() {
  fuck0::solve();
  x = n - 1, y = n;
  for (int i = 1; i + 3 <= n; i += 4) {
    if (i == 1) {
      tmp = {1, x, y};
      push();
      push();
      tmp = {x, 2, y, 3};
      push();
      tmp = {x, 3, y, 4};
      push();
      tmp = {x, 4, y, 2};
      push();
    } else
      solve(i, i + 1), solve(i + 2, i + 3);
  }
}
}  // namespace fuck2
namespace fuck1 {
void solve(int a, int b, int c, int d) {
  tmp = {a, b, c, d};
  push();
  push();
  tmp = {a, n, c};
  push();
  push();
  tmp = {b, n, d};
  push();
  push();
  return;
}
void solve(int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4) {
  tmp = {a1, b1, a2, b2};
  push();
  push();
  tmp = {a3, b3, a4, b4};
  push();
  push();
  tmp = {a1, b3, a2, b4};
  push();
  push();
  tmp = {a3, b1, a4, b2};
  push();
  push();
  return;
}
void solve() {
  for (int i = 1; i + 3 <= n; i += 4) {
    solve(i, i + 1, i + 2, i + 3);
    for (int j = i + 4; j + 3 <= n; j += 4)
      solve(i, i + 1, i + 2, i + 3, j, j + 1, j + 2, j + 3);
  }
  return;
}
}  // namespace fuck1
int main() {
  scf(n);
  if (n % 4 == 0)
    fuck0::solve();
  else if (n % 4 == 1)
    fuck1::solve();
  else if (n % 4 == 2)
    fuck2::solve();
  else
    fuck3::solve();
  printf("%d\n", (int)ans.size());
  for (auto x : ans) {
    printf("%d", (int)x.size());
    for (int y : x) printf(" %d", y);
    puts("");
  }
  return 0;
}

### Prompt

Please provide a cpp coded solution 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;
const int iinf = 1e9 + 7;
const int oo = 0x3f3f3f3f;
const long long linf = 1ll << 60;
const double dinf = 1e60;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
template <typename T1, typename T2, typename T3, typename T4>
void scf(T1 &x, T2 &y, T3 &z, T4 &w) {
  scf(x);
  scf(y);
  scf(z);
  return scf(w);
}
inline char mygetchar() {
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
template <typename T>
inline bool chkmax(T &x, const T &y) {
  return y > x ? x = y, 1 : 0;
}
template <typename T>
inline bool chkmin(T &x, const T &y) {
  return y < x ? x = y, 1 : 0;
}
const int maxn = 310;
int n;
vector<vector<int> > ans;
vector<int> tmp;
int g[maxn][maxn];
void link(int u, int v) {
  if (u < v) swap(u, v);
  if (!g[u][v]) assert(0);
  --g[u][v];
}
void push() {
  ans.push_back(tmp);
  return;
}
namespace fuck0 {
void solve(int a, int b, int c, int d) {
  tmp = {a, b, c, d};
  push();
  tmp = {a, b, d, c};
  push();
  tmp = {a, d, b, c};
  push();
  return;
}
void solve(int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4) {
  tmp = {a1, b1, a2, b2};
  push();
  push();
  tmp = {a3, b3, a4, b4};
  push();
  push();
  tmp = {a1, b3, a2, b4};
  push();
  push();
  tmp = {a3, b1, a4, b2};
  push();
  push();
  return;
}
void solve() {
  for (int i = 1; i + 3 <= n; i += 4) {
    solve(i, i + 1, i + 2, i + 3);
    for (int j = i + 4; j + 3 <= n; j += 4)
      solve(i, i + 1, i + 2, i + 3, j, j + 1, j + 2, j + 3);
  }
  return;
}
}  // namespace fuck0
namespace fuck3 {
int x, y, z;
void solve(int a, int b) {
  tmp = {a, x, b, y};
  push();
  tmp = {a, x, b, z};
  push();
  tmp = {a, y, b, z};
  push();
  return;
}
void solve() {
  fuck0::solve();
  x = n - 2, y = n - 1, z = n;
  ;
  ;
  tmp = {x, y, z};
  push();
  push();
  for (int i = 1; i + 3 <= n; i += 4) solve(i, i + 1), solve(i + 2, i + 3);
  return;
}
}  // namespace fuck3
namespace fuck2 {
int x, y;
void solve(int a, int b) {
  tmp = {x, a, y, b};
  push();
  push();
  return;
}
void solve() {
  fuck0::solve();
  x = n - 1, y = n;
  for (int i = 1; i + 3 <= n; i += 4) {
    if (i == 1) {
      tmp = {1, x, y};
      push();
      push();
      tmp = {x, 2, y, 3};
      push();
      tmp = {x, 3, y, 4};
      push();
      tmp = {x, 4, y, 2};
      push();
    } else
      solve(i, i + 1), solve(i + 2, i + 3);
  }
}
}  // namespace fuck2
namespace fuck1 {
void solve(int a, int b, int c, int d) {
  tmp = {a, b, c, d};
  push();
  push();
  tmp = {a, n, c};
  push();
  push();
  tmp = {b, n, d};
  push();
  push();
  return;
}
void solve(int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4) {
  tmp = {a1, b1, a2, b2};
  push();
  push();
  tmp = {a3, b3, a4, b4};
  push();
  push();
  tmp = {a1, b3, a2, b4};
  push();
  push();
  tmp = {a3, b1, a4, b2};
  push();
  push();
  return;
}
void solve() {
  for (int i = 1; i + 3 <= n; i += 4) {
    solve(i, i + 1, i + 2, i + 3);
    for (int j = i + 4; j + 3 <= n; j += 4)
      solve(i, i + 1, i + 2, i + 3, j, j + 1, j + 2, j + 3);
  }
  return;
}
}  // namespace fuck1
int main() {
  scf(n);
  if (n % 4 == 0)
    fuck0::solve();
  else if (n % 4 == 1)
    fuck1::solve();
  else if (n % 4 == 2)
    fuck2::solve();
  else
    fuck3::solve();
  printf("%d\n", (int)ans.size());
  for (auto x : ans) {
    printf("%d", (int)x.size());
    for (int y : x) printf(" %d", y);
    puts("");
  }
  return 0;
}

```