Preparando MOJI
Polycarp is developing a method for transmitting $$$n$$$ integer sequences over a network. This method should support the transmission of an arbitrary number of integer sequences; sequences can have different lengths. The sequences contain arbitrary non-negative integers.
Polycarp developed the following encoding procedure:
For example, if you want to encode three sequences $$$[3, 1, 4]$$$, $$$[2, 7]$$$ and $$$[1, 2, 3, 4]$$$, then the sequence of actions will be as follows:
Your task is to implement decoding by a given encoding result.
The first line contains integer number $$$m$$$ ($$$1 \le m \le 3\cdot10^5$$$), denoting the length of the encoding result. The second line contains the result of encoding as a sequence of integers $$$b_1, b_2, \dots, b_m$$$ ($$$-1 \le b_i \le 100$$$).
It is guaranteed that in the initial sequences before encoding contains only non-negative integers from $$$0$$$ to $$$100$$$, that you are in fact given the result of correct encoding (in other words, it is guaranteed that the answer exists). It is possible that one or more initial sequences were empty before encoding.
Print $$$n$$$, where $$$n$$$ is the number of encoded sequences. Then print $$$n$$$ lines in the format $$$k_i, a_{i1}, a_{i2}, \dots, a_{ik_i}$$$, where $$$k_i$$$ is the length of the $$$i$$$-th sequence, and $$$a_{i1}, a_{i2}, \dots, a_{ik_i}$$$ are its elements. Separate the numbers in the lines with spaces. Please note that the encoding procedure is such that every possible encoding result can be decoded in only one way.
12 3 2 1 1 7 2 4 -1 3 -1 4 -1
3 3 3 1 4 2 2 7 4 1 2 3 4
6 2 -1 2 -1 3 -1
3 1 2 0 2 2 3