On the planet Bitaculandia, there is an annual prestigious competition hosted by Miss M --- an international team championship.

Residents from all countries of Bitaculandia participate in this competition. The championship also involves solving problems with very interesting legends, like this one, but in teams. The best teams, according to the championship results, receive prizes.

Miss M has finally received the long-awaited gifts for the championship, which need to be sent to the winners. She realized that there are many gifts. And while everything is clear with mugs and packets, there was a problem with T-shirts. Each team has three participants, and each of them ordered a T-shirt of one of $n$ colors and one of $m$ sizes. But Miss M is not sure that all the winners' wishes will be fulfilled...

Therefore, Miss M developed an algorithm according to which she will collect gifts for the teams.
\begin{enumerate}
\item If a T-shirt of the required size and color is still available, she takes it.
\item Otherwise, she looks for a T-shirt of the same size but a different color. If there are several, then the color with the minimum number.
\item Otherwise, she looks at T-shirts of the next larger size, but with the priority of the color indicated by the team at the beginning. If there are no T-shirts with the prioritized color, but there are several others, we choose the T-shirt with the minimum color number.
\item Otherwise, we repeat the process of the previous step among T-shirts of the next larger size. We continue this process until such sizes are available.
\item If none of the remaining T-shirts are suitable, then the T-shirt indicated by the team is recorded as absent.
\end{enumerate}

Miss M decided that she needs to send back to the warehouse the T-shirts that turned out to be superfluous and order more of the T-shirts that she recorded as absent, to satisfy all the participants of the championship. To avoid sorting all the T-shirts by hand, Miss M asks you to write a program that:
\begin{enumerate} 
\item Outputs which specific T-shirts turned out to be superfluous in the format of a table of size $n \times m$, where $l_{ij}$ --- the number of T-shirts of the $i$-th color and $j$-th size that remained after she distributed T-shirts to all participants.
\item Outputs which T-shirts need to be ordered in the format of a table of size $n \times m$, where $n_{ij}$ --- the number of T-shirts of the $i$-th color and $j$-th size that participants asked for, but the organizers could not give any T-shirts.
\end{enumerate}