#include <bits/stdc++.h>
using namespace std;
int x[100];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x[i];
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  } else if (n == 2) {
    if (x[1] == 1 && x[2] == 2) {
      cout << 0 << endl;
    } else
      cout << "1\n2 1 1\n";
    return 0;
  }
  vector<vector<int> > vec;
  int l = (n + 1) / 2, r = l + 1, flg = 0, ans_flg = 0;
  for (int i = 1; i <= n; i++) {
    int now;
    if (!flg)
      now = l--;
    else
      now = r++;
    flg ^= 1;
    for (int j = 1; j <= n; j++) {
      if (x[j] == now) {
        int a = i - 1;
        int b = j - i + 1;
        int c = n - j;
        vector<int> tmp;
        if (a != 0) tmp.push_back(a);
        if (b != 0) tmp.push_back(b);
        if (c != 0) tmp.push_back(c);
        if (tmp.size() == 1) {
          tmp.clear();
          for (int i = 1; i <= n; i++) tmp.push_back(1);
          ans_flg = 1;
          reverse(x + 1, x + n + 1);
        } else {
          reverse(x + 1, x + a + 1);
          reverse(x + a + 1, x + a + b + 1);
          reverse(x + a + b + 1, x + a + b + c + 1);
          vec.push_back(tmp);
        }
      }
    }
  }
  cout << vec.size() << endl;
  for (auto &it : vec) {
    cout << it.size() << " ";
    if (ans_flg) reverse(it.begin(), it.end());
    for (auto &it2 : it) cout << it2 << " ";
    cout << endl;
    ans_flg ^= 1;
  }
}
