#include <bits/stdc++.h>
using namespace std;
constexpr int nax = 52;
int n, tab[nax + 1];
vector<vector<int> > ilo;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> tab[i];
  for (int i = 1; i < n; ++i) {
    int d = find(begin(tab) + 1, begin(tab) + n + 1, i) - begin(tab);
    ilo.push_back(vector<int>());
    if (i & 1) {
      if (d > 1) ilo.back().push_back(d - 1);
      if (n - d + 1 - (i - 1) > 0) ilo.back().push_back(n - d + 1 - (i - 1));
      for (int j = 1; j < i; ++j) ilo.back().push_back(1);
    } else {
      for (int j = 1; j < i; ++j) ilo.back().push_back(1);
      if (d - i + 1 > 0) ilo.back().push_back(d - i + 1);
      if (n - d > 0) ilo.back().push_back(n - d);
    }
    vector<vector<int> > arr;
    int sm = 1;
    for (int v : ilo.back()) {
      arr.push_back(vector<int>());
      for (int j = sm; j <= sm + v - 1; ++j) arr.back().push_back(tab[j]);
      sm += v;
    }
    reverse(begin(arr), end(arr));
    sm = 1;
    for (const auto& vv : arr)
      for (int v : vv) tab[sm++] = v;
  }
  if (n & 1) {
    ilo.push_back(vector<int>());
    for (int i = 1; i <= n; ++i) ilo.back().push_back(1);
    vector<vector<int> > arr;
    int sm = 1;
    for (int v : ilo.back()) {
      arr.push_back(vector<int>());
      for (int j = sm; j <= sm + v - 1; ++j) arr.back().push_back(tab[j]);
      sm += v;
    }
    reverse(begin(arr), end(arr));
    sm = 1;
    for (const auto& vv : arr)
      for (int v : vv) tab[sm++] = v;
  }
  int cnt = 0;
  for (const auto& vv : ilo)
    if (vv.size() > 1) ++cnt;
  cout << cnt << '\n';
  for (const auto& vv : ilo)
    if (vv.size() > 1) {
      cout << vv.size() << ' ';
      for (int v : vv) cout << v << ' ';
      cout << '\n';
    }
}
