Bermuda Triangle#489

Bermuda Triangle

1 second
64 megabytes
Easy

Bermuda Triangle — an area in the Atlantic Ocean where mysterious disappearances of sea and air vessels allegedly occur. The area is bounded by lines from Florida to Bermuda, then to Puerto Rico, and back to Florida through the Bahamas. Various hypotheses have been proposed to explain these disappearances, from unusual weather phenomena to alien abductions.

One of the latest theories is associated with the presence of a complex system of currents near Bermuda. Researchers have created a detailed map of the most dangerous part of the Bermuda Triangle. The depicted area has the shape of a rectangle. The map is divided into a grid of square cells, each indicating the direction of the current: east, north-east, north, north-west, west, south-west, south, south-east, or whirlpool. If a boat enters a cell with a given current direction, in one unit of time, it moves under the influence of the current to the cell in that direction. If the boat enters a cell marked as a whirlpool, it immediately sinks to the bottom. In the course of these studies, you are tasked with determining where and after how much time a boat will end up after entering a given cell.

Input

The first line contains two integers and (1 \leq N, M \leq 200), which define the size of the depicted area. The following is a table of size N \times M, where each cell contains information about the direction of the current in the corresponding part of the area. Each cell contains one of the following values: east, north-east, north, north-west, west, south-west, south, south-east, or whirlpool. Then, in a separate line, two integers and are given, which specify the coordinates (row and column, respectively) of the cell where the boat initially is.

Output

If the boat leaves the depicted area after some time, output "Boat has been carried out in K move(s).", where is the number of moves until the boat exits the area. If the boat sinks, output "Whirlpool in K move(s)!", where is the number of moves until it enters a whirlpool. If the boat never leaves the depicted area, output "The Bermuda Triangle...".

Examples

Example 1

Loading
Loading