#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int n = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    n = 10 * n + (c ^ '0');
    c = getchar();
  }
  return f * n;
}
const int MAXN = 60;
int a[MAXN], b[MAXN];
int n, m;
void slove(bool f, int t, int k) {
  int p;
  for (int i = 1; i <= n; i++) {
    if (a[i] == k) p = i;
  }
  int x, y, z;
  if (f) {
    x = p - 1, z = t, y = n - x - z;
  } else {
    x = t, z = n - p, y = n - x - z;
  }
  printf("%d", (x != 0) + (y != 0) + (z != 0));
  if (x != 0) printf(" %d", x);
  if (y != 0) printf(" %d", y);
  if (z != 0) printf(" %d", z);
  puts("");
  int o = 0;
  for (int i = x + y + 1; i <= n; i++) b[++o] = a[i];
  for (int i = x + 1; i <= x + y; i++) b[++o] = a[i];
  for (int i = 1; i <= x; i++) b[++o] = a[i];
  for (int i = 1; i <= n; i++) a[i] = b[i];
}
int main() {
  n = read(), m = n / 2 + 1;
  for (int i = 1; i <= n; i++) a[i] = read();
  int k = (a[1] == m);
  printf("%d\n", n - k);
  for (int i = 1; i <= n; i++) {
    if (i == 1 && k == 1) continue;
    if (i & 1) {
      slove(1, i - 1, m + i / 2);
    } else {
      slove(0, i - 1, m - i / 2);
    }
  }
  return 0;
}
