### constant

NUMBERS = [
  ['#######', '#.....#', '#...|.#', '#.....#', '#...|.#', '#..-..#', '#######'],
  ['#######', '#..-..#', '#...|.#', '#..-..#', '#.|...#', '#..-..#', '#######'],
  ['#######', '#..-..#', '#...|.#', '#..-..#', '#...|.#', '#..-..#', '#######'],
  ['#######', '#.....#', '#.|.|.#', '#..-..#', '#...|.#', '#.....#', '#######'],
  ['#######', '#..-..#', '#.|...#', '#..-..#', '#...|.#', '#..-..#', '#######'],
  ['#######', '#..-..#', '#.|...#', '#..-..#', '#.|.|.#', '#..-..#', '#######'],
  ['#######', '#..-..#', '#...|.#', '#.....#', '#...|.#', '#.....#', '#######'],
  ['#######', '#..-..#', '#.|.|.#', '#..-..#', '#.|.|.#', '#..-..#', '#######'],
  ['#######', '#..-..#', '#.|.|.#', '#..-..#', '#...|.#', '#..-..#', '#######']
]

ROTCHS = {'#' => '#', '.' => '.', '-' => '|', '|' => '-'}

### subroutines

def rev_lr(num)
  num0 = 7.times.map{' ' * 7}
  for y in (0..6)
    for x in (0..6)
      num0[y][6 - x] = num[y][x]
    end
  end
  num0
end

def rev_td(num)
  num0 = 7.times.map{' ' * 7}
  for y in (0..6)
    num0[6 - y] = num[y].clone
  end
  num0
end

def rot_90(num)
  num0 = 7.times.map{' ' * 7}
  for y in (0..6)
    for x in (0..6)
      num0[6 - x][y] = ROTCHS[num[y][x]]
    end
  end
  num0
end

def rot_270(num)
  num0 = 7.times.map{' ' * 7}
  for y in (0..6)
    for x in (0..6)
      num0[x][6 - y] = ROTCHS[num[y][x]]
    end
  end
  num0
end

def cut_num(dice, y, x)
  num = []
  for y0 in (y..(y + 6))
    num << dice[y0][x..(x + 6)]
  end
  num
end

def find_num(num)
  #num.each{|n| puts n}
  NUMBERS.index(num) + 1
end

def parse_dice(dice)
  ds = []
  ds << find_num(rev_lr(cut_num(dice, 0, 7)))
  ds << find_num(rot_90(rev_lr(cut_num(dice, 7, 0))))
  ds << find_num(rev_lr(cut_num(dice, 7, 7)))
  ds << find_num(rot_270(rev_lr(cut_num(dice, 7, 14))))
  ds << find_num(rev_lr(cut_num(dice, 7, 21)))
  ds << find_num(rev_lr(rev_td(cut_num(dice, 14, 7))))
  ds
end

### main

loop do
  line = gets.strip
  break if line == '0'

  dice0 = [line[0..27]]
  dice1 = [line[29..56]]

  20.times do
    line = gets.strip
    dice0 << line[0..27]
    dice1 << line[29..56]
  end

  ds0 = parse_dice(dice0)
  ds1 = parse_dice(dice1)
  #p ds0
  #p ds1

  #exp0 = ds0.inject(0.0){|s, d| s + d} / 6
  #exp1 = ds1.inject(0.0){|s, d| s + d} / 6
  #p [exp0, exp1]

  win = lose = 0
  for d0 in ds0
    for d1 in ds1
      if d0 > d1
        win += 1
      elsif d0 < d1
        lose += 1
      end
    end
  end
  #p [win, lose]
  puts (win >= lose ? 'HIGH' : 'LOW')
end