Thanks to MikeMirzayanov

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

... for beautiful Codeforces and Polygon platforms. And thanks to XTX Markets for supporting Codeforces Global Rounds. And also big thanks to dario2994 who was an author of Codeforces Global Round 11 and who has permitted to reuse his problem https://codeforces.com/contest/1427/problem/D. Yep, that's exactly the same problem apart from that doing it in nn operations is kinda boring, don't you agree?

You are given a deck of nn cards numbered from 1 to nn (not necessarily in this order in the deck). You have to sort the deck by repeating the following operation.

Choose 2kn2 \le k \le n and split the deck in kk nonempty contiguous parts D_1,D_2,,D_kD\_{1}, D\_{2}, \ldots, D\_{k} (D_1D\_{1} contains the first D_1|D\_{1}| cards of the deck, D_2D\_{2} contains the following D_2|D\_{2}| cards and so on). Then reverse the order of the parts, transforming the deck into D_k,D_k1,,D_2,D_1D\_{k}, D\_{k-1}, \ldots, D\_{2}, D\_{1} (so, the first D_k|D\_{k}| cards of the new deck are D_kD\_{k}, the following D_k1|D\_{k-1}| cards are D_k1D\_{k-1} and so on). The internal order of each packet of cards D_iD\_{i} is unchanged by the operation.

You have to obtain a sorted deck (that is, a deck where the first card is 1, the second is 2 and so on) performing at most 120120 operations. It can be proven that it is always possible to sort the deck performing at most 120120 operations under the limitations of this problem.

Examples of operation: the following are three examples of valid operations (on three decks with different sizes).

  • If the deck is [3 6 2 1 4 5 7] (so 3 is the first card and 7 is the last card), we may apply the operation with k=4k=4 and D_1=D\_{1}=[3 6], D_2=D\_{2}=[2 1 4], D_3=D\_{3}=[5], D_4=D\_{4}=[7]. Doing so, the deck becomes [7 5 2 1 4 3 6].
  • If the deck is [3 1 2], we may apply the operation with k=3k=3 and D_1=D\_{1}=[3], D_2=D\_{2}=[1], D_3=D\_{3}=[2]. Doing so, the deck becomes [2 1 3].
  • If the deck is [5 1 2 4 3 6], we may apply the operation with k=2k=2 and D_1=D\_{1}=[5 1], D_2=D\_{2}=[2 4 3 6]. Doing so, the deck becomes [2 4 3 6 5 1].

입력

The first line of the input contains one integer nn (1n20,0001 \le n \le 20\\,000) --- the number of cards in the deck.

The second line contains nn integers c_1,c_2,,c_nc\_{1}, c\_{2}, \ldots, c\_{n} --- the cards in the deck. The first card is c_1c\_{1}, the second is c_2c\_{2} and so on.

It is guaranteed that for all i=1,,ni=1, \ldots, n there is exactly one j1,,nj \in \\{ 1, \ldots, n \\} such that c_j=ic\_{j} = i.

출력

On the first line, print the number qq of operations you perform (it must hold that 0q1200 \le q \le 120).

Then, print qq lines, each describing one operation.

To describe an operation, print on a single line the number kk of parts you are going to split the deck in, followed by the sizes of the kk parts: D_1,D_2,,D_k|D\_{1}|, |D\_{2}|, \ldots, |D\_{k}|.

It must hold that 2kn2 \le k \le n, and D_i1|D\_{i}| \ge 1 for all i=1,,ki=1, \ldots, k, and D_1+D_2++D_k=n|D\_{1}|+|D\_{2}|+\ldots+|D\_{k}|=n.

It can be proven that it is always possible to sort the deck performing at most 120 operations under the limitations of this problem. If there are several ways to sort the deck you can output any one of them. Note that you don't have to minimize qq.