12. Modify the program from the previous exercise so that it prints the maze with the path without dead ends; the path is indicated by dashes and vertical bars to indicate the changes of direction of the path; for the input maze from the previous exercise, the modified program should output
$$
\begin{aligned}
& 1111111 \\
& 1 \mathrm{e}--\ldots 1 \\
& 111 \mid 111 \\
& 1 \ldots \mid--1 \\
& 1 \ldots \mathrm{m}-\mid 1 \\
& 1111111
\end{aligned}
$$