The Traffic in Schmenge!


Description

As you know, the Leutonians take security very seriously. Part of the security plan in Leutonia's capital city of Schmenge involves changing the traffic pattern of the city on a daily basis, and routing all Leutonian government officials to the main government building by the fastest possible route.

You, the Schmenge Minister of Traffic, have been assigned to come up with a way to solve this problem, for Schmenge, and for the various state capitals.

Since Leutonians have outlawed decimal numbers as unholy, speed limits are always integer values. This explains why capital blocks are precisely 2,520 stopa in length: (Fortunately, government officials such as yourself do not worry with silly superstitions about 3's and 7's!)

Thus, the time required to travel between two adjacent intersections is always an integer number of pacierz.

In all Leutonian capitals, government housing is always at the northwest corner of the city, while the main government building is always at the southeast corner. Streets between intersections might be one-way or two-way, or possibly even closed for repair. (All this daily changing with traffic patterns causes a lot of accidents!) Your job, given

for that capital city for that day is to determine the fastest route from government housing to the main government building. It may be possible, due to street directions and closures, that no route exists. In that case, a Leutonian official temporary holiday is declared, and the Leutonian officials take the day off.

A Leutonian capital

The picture above shows a Leutonian Captial marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit — laws are strictly enforced! — and that turning a corner takes zero time.

Under these conditions, you should be able to determine the following.


Input

The input consists of a set of capitals for which you must find a fastest route, if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest capital city is a single block, or 1 by 1, and the largest is 20 by 20 blocks.

The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time.


Sample Input

2 2
9 * 9 *
6 v 0 * 8 v
3 * 7 *
3 * 6 v 3 *
4 * 8 *
2 2
9 * 9 *
6 v 9 * 8 v
3 * 7 *
3 * 6 v 3 *
4 * 8 *
2 2
9 * 9 *
6 ^ 0 * 8 ^
3 * 7 *
3 * 6 ^ 3 *
4 * 8 *
0 0

Output

For each input scenario, output a line specifying the integer number of pacierz of the shortest route, a space, and then the word “pacierz”. For scenarios which have no route, output a line with the word “Holiday”.


Sample Output

1715 pacierz
1295 pacierz
Holiday