The Lord of the Rings

No attempts yetTime limit1sMemory limit128 MB

Problem

After the Fellowship of the Ring defeated the dark wizard Saruman, he narrowly escaped and raised a new army to march on the human countries once more. Middle-earth split into two sides: Saruman's forces and the humans. To survive, every human country joined a single alliance under these rules.

  1. Human countries that are physically adjacent are allies.
  2. Whenever an adjacent country CjC_j is attacked, each neighboring human country CiC_i sends fi/(ai+1)\lfloor f_i / (a_i + 1) \rfloor soldiers to help defend it. Here aia_i is the number of countries adjacent to CiC_i and fif_i is the number of CiC_i's own soldiers. The size of each reinforcement is fixed before the first battle and never changes unless CiC_i or CjC_j is destroyed.
  3. When a human country is attacked, it fights with all of the soldiers it still has at home, together with every reinforcement sent to it.

The human lands form a rectangle divided into unit grid cells. Each human country is a single region of connected cells, named by a capital letter. Two countries are adjacent when at least one pair of their cells shares a grid edge (touching only at a corner does not count). A country in the interior, fully surrounded by others, can still be attacked directly.

For example, the land below is 4×54 \times 5 and holds countries A through D. A and C are adjacent because their cells share a border, but B and C are not.

Saruman attacks exactly one country at a time and always commits all of his soldiers. The side with more soldiers wins the battle; if both sides have the same number, the human country wins. Every soldier of the losing country dies, including any reinforcements present there, while the winning side loses no one. A reinforcement that dies at a destroyed ally is lost for good from the country that sent it. Saruman keeps all of his soldiers after each victory and may choose the order in which he attacks.

On the same 4×54 \times 5 map, suppose A, B, C, and D own 160, 300, 60, and 80 soldiers. Saruman cannot conquer everyone with 200 soldiers, but with 210 he can, by destroying C, D, A, and B in that order.

Given the map together with the number of soldiers of each human country and of Saruman, decide which side ends up ruling Middle-earth.

Input

The first line contains the number of test cases TT. Each test case has four parts.

  • A line with two integers mm and nn (1m,n301 \le m, n \le 30), the number of rows and columns of the land.
  • mm lines, each a string of length nn. The characters are country names from A to Z. If there are cc countries, their names are the first cc capital letters.
  • A line with cc integers: each country's own number of soldiers, listed in alphabetical order of the country names.
  • A line with the number of Saruman's soldiers.

Every soldier count is strictly greater than 00 and strictly less than 100000100000.

Output

For each test case, print exactly one line with the winner: either Human or Saruman.