#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

vector<string> saikoro[10];

void Print(vector<string> &strs) {
  REP(y, strs.size()) {
    cout << strs[y] << endl;
  }
  cout << endl;
}

void LR(vector<string> &strs) {
  REP(y, 7) {
    REP(x, 3) {
      swap(strs[y][x], strs[y][6 - x]);
    }
  }
}

void UB(vector<string> &strs) {
  REP(y, 3) {
    REP(x, 7) {
      swap(strs[y][x], strs[6 - y][x]);
    }
  }
}

void Rotate(vector<string> &strs, int cnt) {
  if (cnt == 0) { return; }
  vector<string> temp = strs;
  REP(y, 7) {
    REP(x, 7) {
      temp[y][x] = strs[x][6 - y];
      if (temp[y][x] == '-') { temp[y][x] = '|'; }
      else if (temp[y][x] == '|') { temp[y][x] = '-'; }
    }
  }
  strs = temp;
  Rotate(strs, cnt - 1);
}

int calc(vector<string> strs, int pos) {
  FOREQ(i, 1, 9) {
    vector<string> s = saikoro[i];
    if (pos == 0 || pos == 2 || pos == 4) {
      LR(s);
    } else if (pos == 1) {
      LR(s);
      Rotate(s, 1);
    } else if (pos == 3) {
      LR(s);
      Rotate(s, 3);
    } else if (pos == 5) {
      UB(s);
      LR(s);
    } else {
      assert(false);
    }
    if (s == strs) {
      return i;
    }
  }
  //Print(strs);
  assert(false);
  return -1;
}

char field[100][100];
int px[2][6] = { { 7, 0, 7, 14, 21, 7 }, { 36, 29, 36, 43, 50, 36 } };
int py[2][6] = { { 0, 7, 7, 7, 7, 14 }, {0, 7, 7, 7, 7, 14 } };

int main() {
  saikoro[1].push_back("#######");
  saikoro[1].push_back("#.....#");
  saikoro[1].push_back("#...|.#");
  saikoro[1].push_back("#.....#");
  saikoro[1].push_back("#...|.#");
  saikoro[1].push_back("#..-..#");
  saikoro[1].push_back("#######");

  saikoro[2].push_back("#######");
  saikoro[2].push_back("#..-..#");
  saikoro[2].push_back("#...|.#");
  saikoro[2].push_back("#..-..#");
  saikoro[2].push_back("#.|...#");
  saikoro[2].push_back("#..-..#");
  saikoro[2].push_back("#######");

  saikoro[3].push_back("#######");
  saikoro[3].push_back("#..-..#");
  saikoro[3].push_back("#...|.#");
  saikoro[3].push_back("#..-..#");
  saikoro[3].push_back("#...|.#");
  saikoro[3].push_back("#..-..#");
  saikoro[3].push_back("#######");

  saikoro[4].push_back("#######");
  saikoro[4].push_back("#.....#");
  saikoro[4].push_back("#.|.|.#");
  saikoro[4].push_back("#..-..#");
  saikoro[4].push_back("#...|.#");
  saikoro[4].push_back("#.....#");
  saikoro[4].push_back("#######");

  saikoro[5].push_back("#######");
  saikoro[5].push_back("#..-..#");
  saikoro[5].push_back("#.|...#");
  saikoro[5].push_back("#..-..#");
  saikoro[5].push_back("#...|.#");
  saikoro[5].push_back("#..-..#");
  saikoro[5].push_back("#######");

  saikoro[6].push_back("#######");
  saikoro[6].push_back("#..-..#");
  saikoro[6].push_back("#.|...#");
  saikoro[6].push_back("#..-..#");
  saikoro[6].push_back("#.|.|.#");
  saikoro[6].push_back("#..-..#");
  saikoro[6].push_back("#######");

  saikoro[7].push_back("#######");
  saikoro[7].push_back("#..-..#");
  saikoro[7].push_back("#...|.#");
  saikoro[7].push_back("#.....#");
  saikoro[7].push_back("#...|.#");
  saikoro[7].push_back("#.....#");
  saikoro[7].push_back("#######");

  saikoro[8].push_back("#######");
  saikoro[8].push_back("#..-..#");
  saikoro[8].push_back("#.|.|.#");
  saikoro[8].push_back("#..-..#");
  saikoro[8].push_back("#.|.|.#");
  saikoro[8].push_back("#..-..#");
  saikoro[8].push_back("#######");

  saikoro[9].push_back("#######");
  saikoro[9].push_back("#..-..#");
  saikoro[9].push_back("#.|.|.#");
  saikoro[9].push_back("#..-..#");
  saikoro[9].push_back("#...|.#");
  saikoro[9].push_back("#..-..#");
  saikoro[9].push_back("#######");

  while (true) {
    REP(y, 21) {
      scanf("%s", field[y]);
    }
    if (field[0][0] == '0') { break; }
    vector<int> value[2];
    REP(iter, 2) {
      REP(i, 6) {
        vector<string> strs;
        REP(yy, 7) {
          string s = "";
          REP(xx, 7) {
            int x = xx + px[iter][i];
            int y = yy + py[iter][i];
            s += field[y][x];
          }
          strs.push_back(s);
        }
        value[iter].push_back(calc(strs, i));
      }
    }
    int high = 0;
    int low = 0;
    FORIT(it1, value[0]) {
      FORIT(it2, value[1]) {
        if (*it1 > *it2) { high++; }
        if (*it1 < *it2) { low++; }
      }
    }
    if (high >= low) {
      puts("HIGH");
    } else {
      puts("LOW");
    }
  }
}

Measured memory_bytes: 0