Fun House

No attempts yetTime limit1sMemory limit256 MB

Problem

American Carnival Makers Inc. (ACM) has designed rides and attractions for a long time. One of its popular attractions is a fun house with a room of mirrors. The company's trademark is to lay the room out so that the exit door looks like it is straight ahead when you face forward from the entry door. Double sided mirrors stand at 45 degree angles throughout the room, so the exit can end up on any wall. The set designer places the entry and the mirrors and never gets around to placing the exit door. Your job on the construction crew is to work out where the exit goes, given the original design.

A room is a grid of characters. An asterisk (*) marks the entry, a lower case x marks a wall, a forward slash (/) and a backslash (\) mark mirrors, and a period (.) marks open space with nothing in the way. The exit is marked with an ampersand (&). The input diagram still has an x where the exit belongs, so you replace the correct x with an &.

The beam leaves the entry straight into the room and turns 90 degrees at every mirror. A beam that meets / turns from east to north, from north to east, from west to south, and from south to west. A beam that meets \ turns from east to south, from south to east, from west to north, and from north to west. The first wall the beam reaches is the exit.

An entry and an exit can sit on any wall, but never in a corner, and it is physically impossible for the exit to be the same as the entry. (You do not need to understand why this is so, although it may be fun to think about.)

Input

Two integers WW and LL come before each room. WW is the width of the room including the border walls, with 5W205 \le W \le 20, and LL is the length of the room including the border walls, with 5L205 \le L \le 20. The next LL lines hold the room diagram, each line made of WW characters from the alphabet *, x, ., /, \. The perimeter is all walls except for the single asterisk that marks the entrance, and the exit is not marked yet. A line with two zeros ends the input.

Output

For each room, print the word HOUSE, a space, and the number of the room on one line. The numbers start at 1 and follow the order the rooms appear in the input. On the lines below, print the room diagram with the exit door marked by an ampersand (&).

In C++ and Java the backslash (\) is an escape character inside character and string literals. To express a single backslash in source code you have to write \\.