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 MBYeongseon 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.
Because a stick may not be rotated, a stick of length p covers p 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.
The first line contains n and m (1≤n,m≤1000).
Each of the next n lines contains a string of length m describing one row of the board. An empty cell is . and an obstacle is @.
The next line contains the number of stick kinds k (1≤k≤1000).
The next line contains k integers p1,p2,…,pk in ascending order (1≤pi≤1000), where pi is the length of the i-th kind of stick.
Print nein if Yeongseon wins, and hyo123bin if Hyobin wins.