In the first test case:

\begin{shortitems}
\item The distance between ``\texttt{icpc}'' and ``\texttt{nwrrc}'' is $4$: ``\texttt{icpc}'' $\to$ ``\texttt{irpc}'' $\to$ ``\texttt{irrc}'' $\to$ ``\texttt{nrrc}'' $\to$ ``\texttt{nwrrc}''.
\item The distance between ``\texttt{icpc}'' and ``\texttt{itmo}'' is $3$: ``\texttt{icpc}'' $\to$ ``\texttt{itpc}'' $\to$ ``\texttt{itpo}'' $\to$ ``\texttt{itmo}''.
\item The distance between ``\texttt{nwrrc}'' and ``\texttt{itmo}'' is $5$: ``\texttt{nwrrc}'' $\to$ ``\texttt{wrrc}'' $\to$ ``\texttt{wrro}'' $\to$ ``\texttt{irro}'' $\to$ ``\texttt{itro}'' $\to$ ``\texttt{itmo}''.
\end{shortitems}

In the second test case, the distance between each pair of passwords is $2$.

In the third test case, it can be shown that there are no three passwords with the required properties.