I came to the summer festival with the elementary school students in my neighborhood. To put it bluntly, it plays the role of a guardian, but the smell of yakisoba and takoyaki in the store, and the sound of fireworks that can be heard from time to time, are still exciting even at this age. But today I have to keep an eye on the curious children so they don't get lost.

The children seemed to be interested in opening a store. When I looked into it, I was supposed to play a game using dice with the uncle who opened the store, and if I win, I would get a prize. The game is a simple one called High & Low. Participants and uncles roll one dice each, but before that, participants predict whether their rolls will be greater or lesser than their uncle's rolls. If the prediction is correct, it is a victory, and if the same result is rolled, both roll the dice again.

The tricky part of this game is that the dice of the participants and the dice of the uncle may be different. Participants can see the development of both dice in advance, so they can expect it as a hint.

In other words, it's a simple probability calculation. However, the probability is in the range of high school mathematics, and it may be a little heavy for elementary school students. Even the most clever of the kids are thinking, shaking their braided hair. I'll be asking for help soon. By the way, let's show you something that seems to be an adult once in a while.



Input

The input consists of multiple cases.


In each case, a development of the dice is given in a 21x57 grid.
The first 21x28 ((0,0) is the upper left, (20,27) is the lower right) grid represents the participants' dice.
The last 21x28 ((0,29) is the upper left, (20,56) is the lower right) represents the uncle's dice.


Each side of the participant's dice is 7x7 with (0,7), (7,0), (7,7), (7,14), (7,21), (14,7) as the upper left. Given in the subgrid of.
The numbers written on the development drawing are the original numbers.
Flip horizontal
Flip left and right, then rotate 90 degrees counterclockwise
Flip horizontal
Flip left and right, then rotate 270 degrees counterclockwise
Flip horizontal
Flip upside down, then flip left and right
It was made to do.


Each side of the uncle's dice is 7x7 with (0,36), (7,29), (7,36), (7,43), (7,50), (14,36) as the upper left. Given in the subgrid.
The numbers on the uncle's dice development are drawn according to the same rules as the participants' dice.



One of 1 to 9 is written on each side of the dice.
The numbers are given in a 7x7 grid like this:

..... #
... |. #
..... #
... |. #
..-.. #



..-.. #
... |. #
..-.. #
. | ... #
..-.. #



..-.. #
... |. #
..-.. #
... |. #
..-.. #



..... #
. |. |. #
..-.. #
... |. #
..... #



..-.. #
. | ... #
..-.. #
... |. #
..-.. #



..-.. #
. | ... #
..-.. #
. |. |. #
..-.. #



..-.. #
... |. #
..... #
... |. #
..... #



..-.. #
. |. |. #
..-.. #
. |. |. #
..-.. #



..-.. #
. |. |. #
..-.. #
... |. #
..-.. #




However, when the above numbers are rotated 90 degrees or 270 degrees, the "|" and "-" are interchanged.


The end of the input is given by a single 0 line

The dice given as input are always correct. Also, dice that cannot be settled are not given.

Output

Output the one with the higher probability in one line when it becomes "HIGH" and when it becomes "LOW". If both probabilities are the same, output "HIGH".

Examples

Input

.......#######......................#######..............
.......#.....#......................#..-..#..............
.......#.|...#......................#.|.|.#..............
.......#.....#......................#..-..#..............
.......#.|...#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
############################.############################
#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
#.-.-.##...|.##.-.-.##.|.|.#.#.....##.|.|.##.-.-.##.|.|.#
#|.|.|##..-..##|.|.|##..-..#.#....|##..-..##|.|.|##..-..#
#...-.##.|...##...-.##.|.|.#.#.-.-.##.|...##...-.##.|...#
#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
############################.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#.|.|.#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
############################.############################
#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
#.-.-.##...|.##.-.-.##.|.|.#.#...-.##...|.##.-...##.|.|.#
#|.|.|##..-..##|.|.|##..-..#.#|.|.|##..-..##|.|.|##..-..#
#.-.-.##.|...##...-.##.|...#.#.-...##.|.|.##.-.-.##.|...#
#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
############################.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
############################.############################
#.....##..-..##.....##..-..#.#.....##..-..##.....##.....#
#.-.-.##.|.|.##.-.-.##...|.#.#.....##.|.|.##...-.##.|...#
#|.|.|##..-..##|....##..-..#.#....|##..-..##|.|.|##.....#
#.-.-.##.|.|.##.....##.|.|.#.#.-.-.##.|.|.##.-...##.|...#
#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
############################.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|.|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
############################.############################
#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
#.-.-.##...|.##.-.-.##.|.|.#.#.-...##.|.|.##.-...##.|.|.#
#|.|.|##..-..##|.|.|##..-..#.#|.|.|##..-..##|.|.|##..-..#
#...-.##.|...##.-.-.##.|.|.#.#.-.-.##.|...##.-.-.##.|.|.#
#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
############################.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
0


Output

LOW
HIGH
HIGH
LOW


Input

.......#######......................#######..............
.......#.....#......................#..-..#..............
.......#.|...#......................#.|.|.#..............
.......#.....#......................#..-..#..............
.......#.|...#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.############################
.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
.-.-.##...|.##.-.-.##.|.|.#.#.....##.|.|.##.-.-.##.|.|.#
|.|.|##..-..##|.|.|##..-..#.#....|##..-..##|.|.|##..-..#
...-.##.|...##...-.##.|.|.#.#.-.-.##.|...##...-.##.|...#
.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#.|.|.#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.############################
.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
.-.-.##...|.##.-.-.##.|.|.#.#...-.##...|.##.-...##.|.|.#
|.|.|##..-..##|.|.|##..-..#.#|.|.|##..-..##|.|.|##..-..#
.-.-.##.|...##...-.##.|...#.#.-...##.|.|.##.-.-.##.|...#
.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.############################
.....##..-..##.....##..-..#.#.....##..-..##.....##.....#
.-.-.##.|.|.##.-.-.##...|.#.#.....##.|.|.##...-.##.|...#
|.|.|##..-..##|....##..-..#.#....|##..-..##|.|.|##.....#
.-.-.##.|.|.##.....##.|.|.#.#.-.-.##.|.|.##.-...##.|...#
.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|.|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|...#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
.############################
.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
.-.-.##...|.##.-.-.##.|.|.#.#.-...##.|.|.##.-...##.|.|.#
|.|.|##..-..##|.|.|##..-..#.#|.|.|##..-..##|.|.|##..-..#
...-.##.|...##.-.-.##.|.|.#.#.-.-.##.|...##.-.-.##.|.|.#
.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#
.############################
.......#######......................#######..............
.......#..-..#......................#..-..#..............
.......#...|.#......................#.|.|.#..............
.......#..-..#......................#..-..#..............
.......#.|...#......................#...|.#..............
.......#..-..#......................#..-..#..............
.......#######......................#######..............
0


Output

LOW
HIGH
HIGH
LOW

Difficulty: UNKNOWN_DIFFICULTY

Starter code:

Solutions:
class Surface:

	def __init__(self, mp):
		self.mp = mp

	def mirror(self):
		for y in range(5):
			self.mp[y] = self.mp[y][::-1]

	def mirror_ud(self):
		for y in range(2):
			(self.mp[y], self.mp[4 - y]) = (self.mp[4 - y], self.mp[y])

	def spin90(self):
		new_mp = [[None] * 5 for _ in range(5)]
		for y in range(5):
			for x in range(5):
				new_mp[x][4 - y] = self.mp[y][x]
		self.mp = new_mp

	def spin270(self):
		new_mp = [[None] * 5 for _ in range(5)]
		for y in range(5):
			for x in range(5):
				new_mp[4 - x][y] = self.mp[y][x]
		self.mp = new_mp

	def to_hash(self):
		ret = 0
		for y in range(5):
			for x in range(5):
				if self.mp[y][x] != '.':
					ret += 2 ** (y * 5 + x)
		return ret

def calc(lst):
	return sum([2 ** i for i in lst])
hash_dic = {calc([8, 18, 22]): 1, calc([2, 8, 12, 16, 22]): 2, calc([2, 8, 12, 18, 22]): 3, calc([6, 8, 12, 18]): 4, calc([2, 6, 12, 18, 22]): 5, calc([2, 6, 12, 16, 18, 22]): 6, calc([2, 8, 18]): 7, calc([2, 6, 8, 12, 16, 18, 22]): 8, calc([2, 6, 8, 12, 18, 22]): 9}

def make_dice(drawing):
	dice = []
	s1 = Surface([line[8:13] for line in drawing[1:6]])
	s1.mirror()
	dice.append(hash_dic[s1.to_hash()])
	s2 = Surface([line[1:6] for line in drawing[8:13]])
	s2.spin90()
	s2.mirror()
	dice.append(hash_dic[s2.to_hash()])
	s3 = Surface([line[8:13] for line in drawing[8:13]])
	s3.mirror()
	dice.append(hash_dic[s3.to_hash()])
	s4 = Surface([line[15:20] for line in drawing[8:13]])
	s4.spin270()
	s4.mirror()
	dice.append(hash_dic[s4.to_hash()])
	s5 = Surface([line[22:27] for line in drawing[8:13]])
	s5.mirror()
	dice.append(hash_dic[s5.to_hash()])
	s6 = Surface([line[8:13] for line in drawing[15:20]])
	s6.mirror()
	s6.mirror_ud()
	dice.append(hash_dic[s6.to_hash()])
	return dice

def result(dice1, dice2):
	cnt1 = cnt2 = 0
	for num1 in dice1:
		for num2 in dice2:
			if num1 > num2:
				cnt1 += 1
			if num1 < num2:
				cnt2 += 1
	print('HIGH' if cnt1 >= cnt2 else 'LOW')
while True:
	s = input()
	if s == '0':
		break
	(drawing1, drawing2) = ([s[:28]], [s[29:]])
	for _ in range(20):
		s = input()
		drawing1.append(s[:28])
		drawing2.append(s[29:])
	dice1 = make_dice(drawing1)
	dice2 = make_dice(drawing2)
	result(dice1, dice2)