#include <bits/stdc++.h>
using namespace std;
template <class T = int>
T read() {
  T x = 0;
  char ch = 0;
  bool f = false;
  while (!isdigit(ch)) f |= (ch = getchar()) == '-';
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ '0');
  return x;
}
const int N = 100;
int c[N];
int pos[N];
vector<vector<int> > ans;
void qwq(vector<int> v) {
  vector<int> vv;
  int cnt = 1;
  vector<vector<int> > cc;
  for (int x : v)
    if (x) {
      vv.push_back(x);
      cc.push_back(vector<int>(c + cnt, c + cnt + x));
      cnt += x;
    }
  reverse(cc.begin(), cc.end());
  if (vv.size() > 1) {
    ans.push_back(vv);
    cnt = 0;
    for (auto ccc : cc)
      for (int x : ccc) c[++cnt] = x;
    for (int i = (int)(1); i <= (int)(cnt); i++) pos[c[i]] = i;
  }
}
int main() {
  int n = read();
  for (int i = (int)(1); i <= (int)(n); i++) pos[c[i] = read()] = i;
  int sz = 0;
  int mid = (n + 1) >> 1;
  int l = mid + 1, r = mid;
  for (int i = (int)(1); i <= (int)(n); i++) {
    if (i % 2 == 1) {
      l--;
      qwq({sz, pos[l] - sz, n - pos[l]});
    } else {
      r++;
      qwq({pos[r] - 1, n - pos[r] + 1 - sz, sz});
    }
    sz++;
  }
  cout << ans.size() << endl;
  for (vector<int> v : ans) {
    cout << v.size();
    for (int x : v) cout << " " << x;
    cout << endl;
  }
  for (int i = (int)(1); i <= (int)(n); i++) assert(c[i] == i);
  return 0;
}
