\problemname{Ball of Whacks}

Danny has a new toy called Ball of Whacks. It's a rhombic triacontahedron (which
we all know is a thirty sided polyhedron) made of small pyramid-shaped pieces
which look like the following:

\begin{figure}[!h]
\centering
\includegraphics[width=0.1\textwidth]{pic1}
\caption{Game piece.}
\label{fig:bow1}
\end{figure}

When all $30$ pieces are all put together, they form the object shown in
Figure \ref{fig:bow2}a. Figures \ref{fig:bow2}b--\ref{fig:bow2}f show one
way to build a rhombic triacontahedron: at the bottom is a petal-shaped section of
five pyramids (\ref{fig:bow2}b~---~note that only the base of each pyramid piece
is shown); on top of that is a ring of five more pieces
(\ref{fig:bow2}c); on top of that is a larger ring of ten pieces
(\ref{fig:bow2}d), following by a five-piece ring (\ref{fig:bow2}e) and another
petal-shaped section (\ref{fig:bow2}f).
Figure \ref{fig:numbered} contains two other views showing how the pieces are connected to one another.

\begin{figure}[!h]
\centering
\includegraphics[width=0.9\textwidth]{pic2-new}
\caption{Construction of a Ball of Whacks.}
\label{fig:bow2}
\end{figure}

\begin{figure}[!h]
\centering
\includegraphics[width=.4\textwidth]{front-back.png}
\caption{Numbering scheme of an assembled Ball of Whacks}
\label{fig:numbered}
\end{figure}

Danny has several friends who also own
Balls of Whacks, and when they get together$\ldots$ well, balls get whacked. The
result are a number of sections of varying size and shape lying on the floor.
When it's time to go home,
Danny needs to know which sections fit together to make one complete Ball of
Whacks. He would like you to help him.

\section*{Input}
The input file consists of descriptions of three Ball of Whacks sections, each description on a single line.
Each description starts with an integer $m$
indicating the number of pyramid-shaped pieces in the section, followed by a set of numbers
between $1$ and $30$ indicating the relative alignment of the pyramid pieces in
the section, using the numbered locations in diagrams
Figure \ref{fig:bow2}b-\ref{fig:bow2}f. Each
section description starts with a piece in position $1$, though that piece ---
along with all other pieces in the section --- may need to be moved in order for
all three sections to fit together. The pieces in any section will be
connected; i.e., you can get from any one piece in a section to any other by
crossing over pieces which share an internal face.

\section*{Output}
Output either {\tt Yes} if the three sections can be fit together to get one
Ball of Whacks, or {\tt No} if they cannot be fit together.
