Stick Game

Place non-overlapping horizontal sticks of given lengths on a grid with obstacles; find the winner under optimal play.

Medium6Game theoryImplementationNo attempts yetTime limit1sMemory limit512 MB

Problem

Yeongseon and Hyobin are running this contest. There are only two of them, so they work as the staff as well. The contest is small and, unlike a real one, nobody has to tie balloons to chairs, so as long as nothing goes wrong they have almost nothing to do.

They prepared a game to pass the time during the contest. It is called the stick game, and the rules are these.

  1. There is an n×mn \times m grid board.
  2. Some cells hold an obstacle, and a stick may not cover such a cell.
  3. For each given length there is an unlimited supply of 1×p1 \times p sticks.
  4. The two players take turns. On a turn a player picks one stick and places it anywhere on the board.
  5. The player who has no place left to put a stick loses.
  6. Sticks may not overlap, and they may not be rotated.

Because a stick may not be rotated, a stick of length pp covers pp consecutive empty cells inside one row.

The picture shows legal placements.

Both players have plenty of time to think, so both always play optimally. Yeongseon always moves first. Given the board, print the id of the player who wins.

Input

The first line contains nn and mm (1n,m10001 \le n, m \le 1000).

Each of the next nn lines contains a string of length mm describing one row of the board. An empty cell is . and an obstacle is @.

The next line contains the number of stick kinds kk (1k10001 \le k \le 1000).

The next line contains kk integers p1,p2,,pkp_1, p_2, \dots, p_k in ascending order (1pi10001 \le p_i \le 1000), where pip_i is the length of the ii-th kind of stick.

Output

Print nein if Yeongseon wins, and hyo123bin if Hyobin wins.