After an extremely tiring day at work, Tessa arrived home to find her husband waiting proudly at the door. With a huge smile on his face, he announced that he had planted all her flowers in the garden. Grateful that her husband had taken some work off her shoulders, she went straight out to the garden. Her relief lasted exactly until she reached it.
While he did indeed manage to plant all of her flowers around the edge of the garden, unfortunately, the arrangement was very wrong. Roses stood where the orchids should have been. Hyacinths, dahlias, and chrysanthemums were scattered among the hydrangeas. The whole garden looked as though a toddler had planted them.
Tessa stared at the numbered tags still tied to the stems. She had arduously labelled every single flower with non-decreasing labels from left to right of the intended order. Flowers of the same species had matching tags since the order within one type of flower did not matter.
Her husband followed her gaze to the labels, shrugged, and said he thought that they were price tags and had not paid any attention to them ...


Visualization of the second sample answer.
Sighing, she settled down and decided to fix this mess. Since the flowers were still very young and delicate, she cannot just dig out some of the flowers, rearrange them, and then plant them back. Instead, she can do the following operation:
Determine the minimum number of operations Tessa has to do to fix the arrangement, and output one possible sequence of these operations.
The input consists of:
First, output the minimum number of operations $$$k$$$ ($$$0 \leq k \leq n$$$) to fix the arrangement. It can be proven that there always is an answer taking at most $$$n$$$ operations.
Then, for each of the $$$k$$$ operations, output:
Note that only the number of operations has to be minimal, not the number of flowers involved.
If there are multiple optimal solutions, you may output any one of them.
32 3 1
1 3 1 3 2
53 1 3 5 1
1 3 4 1 5
42 1 4 3
2 4 1 2 3 4 2 2 4
| Название |
|---|


