import java.util.*;

public class e {

	final public static int DIST = 2520;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);

		int r = stdin.nextInt();
		int c = stdin.nextInt();

		while (r!=0 || c!=0) {

			int size = (r+1)*(c+1);
			int[][] adj = new int[size][size];
			for (int i=0; i<adj.length; i++)
				Arrays.fill(adj[i], -1);
			for (int i=0; i<adj.length; i++)
				adj[i][i] = 0;

			for (int i=0; i<r+1; i++) {

				// Read in E-W streets
				for (int j=0; j<c; j++) {
					int speed = stdin.nextInt();
					char dir = stdin.next().charAt(0);

					if (speed !=0) {
						if (dir == '>')
							adj[(c+1)*i+j][(c+1)*i+j+1] = DIST/speed;
						else if (dir == '<')
							adj[(c+1)*i+j+1][(c+1)*i+j] = DIST/speed;
						else {
							adj[(c+1)*i+j][(c+1)*i+j+1] = DIST/speed;
							adj[(c+1)*i+j+1][(c+1)*i+j] = DIST/speed;
						}
					}
				}

				if (i == r) break;

				// Read in N-S streets
				for (int j=0; j<c+1; j++) {
					int speed = stdin.nextInt();
					char dir = stdin.next().charAt(0);

					if (speed !=0) {
						if (dir == 'v')
							adj[(c+1)*i+j][(c+1)*(i+1)+j] = DIST/speed;
						else if (dir == '^')
							adj[(c+1)*(i+1)+j][(c+1)*i+j] = DIST/speed;
						else {
							adj[(c+1)*i+j][(c+1)*(i+1)+j] = DIST/speed;
							adj[(c+1)*(i+1)+j][(c+1)*i+j] = DIST/speed;
						}
					}
				}

			}

			// Run Dijkstra's on this.
			solve(adj);
			r = stdin.nextInt();
			c = stdin.nextInt();
		}
	}


	public static void solve(int[][] adj) {

		int n = adj.length;

		int[] d = new int[n];

		Arrays.fill(d, 1000000000);
		d[0] = 0;

		boolean[] used = new boolean[n];
		Arrays.fill(used, false);

		// Run dijstra's
		for (int i=0; i<n; i++) {

			int minIndex = getMin(d, used);
			used[minIndex] = true;

			for (int j=0; j<n; j++) {

				if (adj[minIndex][j] != -1 && d[minIndex] + adj[minIndex][j] < d[j])
					d[j] = d[minIndex] + adj[minIndex][j];
			}
		}

		if (d[n-1] < 1000000000)
			System.out.println(d[n-1]+" blips");
		else
			System.out.println("Holiday");

	}

	public static int getMin(int[] d, boolean[] used) {

		int ans = -1;
		for (int i=0; i<d.length; i++) {
			if (used[i]) continue;
			if (ans == -1 || d[i] < d[ans])
				ans = i;

		}
		return ans;
	}

}