#include <bits/stdc++.h>
using namespace std;

string s[32], pic[2][32];
string numbers[9][7] = {
    {"#######", "#.....#", "#...|.#", "#.....#", "#...|.#",
     "#..-..#", "#######"},
    {"#######", "#..-..#", "#...|.#", "#..-..#", "#.|...#",
     "#..-..#", "#######"},
    {"#######", "#..-..#", "#...|.#", "#..-..#", "#...|.#",
     "#..-..#", "#######"},
    {"#######", "#.....#", "#.|.|.#", "#..-..#", "#...|.#",
     "#.....#", "#######"},
    {"#######", "#..-..#", "#.|...#", "#..-..#", "#...|.#",
     "#..-..#", "#######"},
    {"#######", "#..-..#", "#.|...#", "#..-..#", "#.|.|.#",
     "#..-..#", "#######"},
    {"#######", "#..-..#", "#...|.#", "#.....#", "#...|.#",
     "#.....#", "#######"},
    {"#######", "#..-..#", "#.|.|.#", "#..-..#", "#.|.|.#",
     "#..-..#", "#######"},
    {"#######", "#..-..#", "#.|.|.#", "#..-..#", "#...|.#",
     "#..-..#", "#######"}};
vector<int> v[2];

bool solve();
void lrreverse(int ofstx, int ofsty, int t);
void udreverse(int ofstx, int ofsty, int t);
void rotatel(int ofstx, int ofsty, int t);
void rotater(int ofstx, int ofsty, int t);
int calcnum(int ofstx, int ofsty, int t);

int main() {
  while(1) {
    cin >> s[0];
    if(s[0] == "0") break;
    for(int i = 1; i < 21; ++i) cin >> s[i];
    if(solve())
      cout << "HIGH" << endl;
    else
      cout << "LOW" << endl;
  }
  return 0;
}

bool solve() {
  int cnth = 0, cntl = 0;
  for(int i = 0; i < 21; ++i) {
    pic[0][i] = s[i].substr(0, 28);
    pic[1][i] = s[i].substr(29, 28);
  }
  for(int t = 0; t < 2; ++t) {
    lrreverse(0, 7, t);

    rotater(7, 0, t);
    lrreverse(7, 0, t);

    lrreverse(7, 7, t);

    rotatel(7, 14, t);
    lrreverse(7, 14, t);

    lrreverse(7, 21, t);

    lrreverse(14, 7, t);
    udreverse(14, 7, t);

    v[t].assign(6, 0);
    v[t][0] = calcnum(0, 7, t);
    v[t][1] = calcnum(7, 0, t);
    v[t][2] = calcnum(7, 7, t);
    v[t][3] = calcnum(7, 14, t);
    v[t][4] = calcnum(7, 21, t);
    v[t][5] = calcnum(14, 7, t);
  }

  for(int i = 0; i < 6; ++i)
    for(int j = 0; j < 6; ++j)
      if(v[0][i] > v[1][j])
        ++cnth;
      else if(v[0][i] < v[1][j])
        ++cntl;
  return cnth >= cntl;
}

void lrreverse(int ofstx, int ofsty, int t) {
  for(int i = 0; i < 7; ++i)
    reverse(pic[t][i + ofstx].begin() + ofsty,
            pic[t][i + ofstx].begin() + ofsty + 7);
}

void udreverse(int ofstx, int ofsty, int t) {
  for(int i = 0; i < 3; ++i)
    for(int j = 0; j < 7; ++j)
      swap(pic[t][i + ofstx][j + ofsty],
           pic[t][6 - i + ofstx][j + ofsty]);
}

void rotatel(int ofstx, int ofsty, int t) {
  string tmp[7];
  for(int i = 0; i < 7; ++i)
    for(int j = 0; j < 7; ++j)
      tmp[i] += pic[t][j + ofstx][6 - i + ofsty];
  for(int i = 0; i < 7; ++i)
    for(int j = 0; j < 7; ++j)
      if(tmp[i][j] == '-')
        pic[t][i + ofstx][j + ofsty] = '|';
      else if(tmp[i][j] == '|')
        pic[t][i + ofstx][j + ofsty] = '-';
      else
        pic[t][i + ofstx][j + ofsty] = tmp[i][j];
}

void rotater(int ofstx, int ofsty, int t) {
  for(int i = 0; i < 3; ++i) rotatel(ofstx, ofsty, t);
}

int calcnum(int ofstx, int ofsty, int t) {
  for(int i = 0; i < 9; ++i) {
    bool ch = 1;
    for(int j = 0; j < 7; ++j)
      for(int k = 0; k < 7; ++k)
        if(numbers[i][j][k] != pic[t][ofstx + j][ofsty + k])
          ch = 0;
    if(ch) return i + 1;
  }
  assert(0);
  return -1;
}


Measured memory_bytes: 3224