+ Time Limit: 4 seconds
+ Memory Limit: 256 megabytes
----------
$n$ children in Pardis Park each bought several cards, where each card features a picture of a football player. They bought a total of $m$ cards. Based on the strength and rarity of the cards, they assigned them values such that each card has a unique value between 1 and $m$. A higher number indicates a higher card value.
The children can challenge each other. A challenge proceeds as follows: First, a number $k$ is determined such that both participants have at least $k$ cards. Suppose person $a$ challenges person $b$. Then, each person places their $k$ most valuable cards on the table in order of value. Then, a neutral person stacks the cards as follows: First, the most valuable card of person $a$ is placed, and then the most valuable card of person $b$ is placed on top of the previous card. On top of that, the second most valuable card of person $a$ is placed, followed by the second most valuable card of person $b$, until all $2k$ cards are stacked, forming our deck.
Then, in turns, starting with person $a$, each person strikes (taps) the deck of cards. Each strike causes a certain number of cards from the top of the deck to flip over and fall onto the table. That person then takes all the flipped cards for themselves. This continues until there is at least one card remaining on the table.
Now, you are given the initial list of cards belonging to the children. Then, the challenges and their results are provided, and you must output the final list of cards each person possesses.
# Input
In the first line, two numbers $n$ and $m$ are given, representing the number of children and the total number of cards, respectively.
Then, in the next $n$ lines, the $i$-th line first contains the number $s_i$, which is the count of cards belonging to person $i$, followed by $s_i$ numbers $a_{i, 1}, a_{i,2}, \dots, a_{i, k}$, which are the values of person $i$'s cards. It is guaranteed that the card with value $i$ is held by exactly one person.
Then, the number $q$, which is the number of challenges, is given.
In the next $2q$ lines, two lines of input are given for each challenge. The first line contains $a$, $b$, $k$, and $r$, indicating that person $a$ challenged person $b$, they both put $k$ of their cards on the table, and they struck the cards $r$ times. It is guaranteed that both participants have at least $k$ cards.
Then, the next line contains $r$ numbers $c_i$, which represent the number of cards flipped over after the $i$-th strike. It is guaranteed that the sum of these numbers is exactly equal to $2k$.
# Output
You must output $n$ lines. In the $i$-th line, output the number of cards held by person $i$, followed by the values of their cards in **ascending** order.
# Constraints
$$1 \leq q, n, m \leq 3 \times 10^5$$
$$ \sum s_i = m$$
$$1 \leq k_i, c_i$$
$$1 \leq \sum r_i \leq 3 \times 10^5$$
$$1 \leq a, b \leq n$$
$$a \neq b$$
## Sample Input
```
3 10
4 7 1 8 3
3 10 2 9
3 4 5 6
2
2 3 3 3
3 1 2
1 2 3 2
5 1
```
## Sample Output
```
6 1 3 5 6 7 10
3 2 4 8
1 9
```