#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[100], n, b[100], l[100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  vector<vector<int> > ans;
  while (true) {
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++)
        if (a[i] == a[j] + 1) {
          int p = 1;
          while (i + p <= n && a[i + p] == a[i + p - 1] + 1) p++;
          vector<int> v;
          if (i - 1) v.push_back(i - 1);
          v.push_back(p);
          v.push_back(j - i + 1 - p);
          if (j != n) v.push_back(n - j);
          ans.push_back(v);
          l[0] = 1;
          for (int i = 1; i < v.size(); i++) l[i] = l[i - 1] + v[i - 1];
          int c = 0;
          for (int i = v.size() - 1; i >= 0; i--)
            for (int j = l[i]; j <= l[i] + v[i] - 1; j++) c++, b[c] = a[j];
          for (int i = 1; i <= n; i++) a[i] = b[i];
          break;
        }
    bool isGood = 0;
    for (int i = 2; i <= n; i++)
      if (a[i] < a[i - 1]) isGood = 1;
    if (!isGood) break;
  }
  cout << ans.size() << "\n";
  for (auto x : ans) {
    cout << x.size() << " ";
    for (auto y : x) cout << y << " ";
    cout << "\n";
  }
}
