题目描述
Problem Description
"Tetris" is a classic electronic game. You now wish to write an AI that can play "Tetris" automatically. Initially, "Tetris" has a rectangle with infinite height and a width of $6$, and all the small grids in the rectangle are empty. You will sequentially receive a series of parts, each of which is one of two types, named $A$ and $B$:

After receiving a part, you can rotate it any way you like, and then drop it vertically into any column of the rectangle from a sufficient height (but the part must not exceed the left and right boundaries of the rectangle). During the vertical drop, the part will be immediately fixed upon touching the bottom of the rectangle or any previously fixed part. As shown in the figure below, parts numbered $1$ (type $A$) and $2$ (type $B$) have been fixed. Several possible methods to fix the third part at this moment are:

Now that you have received the sequence of all parts, your task is to fix all parts sequentially as compactly and gaplessly as possible to achieve the highest score. Specifically, your fixed scheme must not include more than $10$ unfilled non-empty rows.
Input Format
Input consists of a single line containing a string composed only of uppercase letters $\texttt{"A"}$ and $\texttt{"B"}$, representing the sequence of parts you receive.
Output Format
Output the fixed parts according to the following rules (refer to the sample output):
- Start from the highest non-empty row and output each row from high to low;
- Each row's output includes $7$ vertical lines $\texttt{"|"}$, used to separate the $6$ grids' fixed part numbers. If a grid does not have any fixed part, output no more than $10$ spaces;
- Ensure that the fixed scheme adheres to the game rules and does not have more than $10$ unfilled non-empty rows.
You can output no more than $10$ spaces between numbers and vertical lines to make your scheme easier to read (extra spaces are included in the sample output). These spaces will be ignored during judging.
Sample Input and Output
Sample Input #1
AABAABAAABAAABB
Sample Output #1
| 13 | 13 | 14 | 14 | | |
| 13 | 9 | 11 | 11 | 15 | 15 |
| 9 | 9 | 10 | 11 | 12 | 12 |
| 6 | 6 | 10 | 7 | 12 | 8 |
| 5 | 5 | 7 | 7 | 8 | 8 |
| 5 | 1 | 2 | 4 | 4 | 3 |
| 1 | 1 | 2 | 2 | 4 | 3 |
Sample Input #2
AAAAABBBBBAAABABABABAABABAABBAAB
Sample Output #2
|29| |30| |31|32|
|29|30|30|31|31|32|
|25|26|26|27|28|28|
|25|21|26|27|27|24|
|21|21|22|22|24|24|
|18|18|22|19|23|23|
|17|17|19|19|20|20|
|17|14|15|15|16|16|
|10|14|11|15|13|13|
|10|11|11|12|12|13|
| 7| 7| 8| 8|12| 9|
| 2| 2| 4| 4| 6| 9|
| 2| 1| 4| 3| 6| 5|
| 1| 1| 3| 3| 5| 5|
Notes
Note: There can be no more than $10$ spaces between numbers and vertical lines.
For $50\%$ of the data, the input string can be written as a repetition of a string of length no more than $3$, such as $\texttt{"ABABABAB...AB"}$ or $\texttt{"BBABBABBA...BBA"}$;
For $100\%$ of the data, the number of parts (i.e., the length of the input string) does not exceed $10,000$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分