#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

string pip[9][7] = 
{
    {"#######",
     "#.....#",
     "#...|.#",
     "#.....#",
     "#...|.#",
     "#..-..#",
     "#######"},
    {"#######",
     "#..-..#",
     "#...|.#",
     "#..-..#",
     "#.|...#",
     "#..-..#",
     "#######"},
    {"#######",
     "#..-..#",
     "#...|.#",
     "#..-..#",
     "#...|.#",
     "#..-..#",
     "#######"},
    {"#######",
     "#.....#",
     "#.|.|.#",
     "#..-..#",
     "#...|.#",
     "#.....#",
     "#######"},
    {"#######",
     "#..-..#",
     "#.|...#",
     "#..-..#",
     "#...|.#",
     "#..-..#",
     "#######"},
    {"#######",
     "#..-..#",
     "#.|...#",
     "#..-..#",
     "#.|.|.#",
     "#..-..#",
     "#######"},
    {"#######",
     "#..-..#",
     "#...|.#",
     "#.....#",
     "#...|.#",
     "#.....#",
     "#######"},
    {"#######",
     "#..-..#",
     "#.|.|.#",
     "#..-..#",
     "#.|.|.#",
     "#..-..#",
     "#######"},
    {"#######",
     "#..-..#",
     "#.|.|.#",
     "#..-..#",
     "#...|.#",
     "#..-..#",
     "#######"}
};

void rotate(vector<string>& s)
{
    vector<string> t(7, string(7, ' '));
    for(int i=0; i<7; ++i){
        for(int j=0; j<7; ++j){
            t[i][j] = s[j][6-i];
            if(t[i][j] == '-')
                t[i][j] = '|';
            else if(t[i][j] == '|')
                t[i][j] = '-';
        }
    }
    s.swap(t);
}

void turnX(vector<string>& s)
{
    for(int i=0; i<7; ++i){
        for(int j=0; j<3; ++j){
            swap(s[i][j], s[i][6-j]);
        }
    }
}

void turnY(vector<string>& s)
{
    for(int i=0; i<7; ++i){
        for(int j=0; j<3; ++j){
            swap(s[j][i], s[6-j][i]);
        }
    }
}

int y[6] = {0, 7, 7, 7, 7, 14};
int x[6] = {7, 0, 7, 14, 21, 7};

int main()
{
    for(;;){
        vector<string> s(21);
        for(int i=0; i<21; ++i)
            cin >> s[i];
        if(s[0] == "0")
            return 0;

        vector<vector<int> > n(2, vector<int>(6, 0));
        for(int i=0; i<2; ++i){
            for(int j=0; j<6; ++j){
                vector<string> t(7);
                for(int k=0; k<7; ++k)
                    t[k] = s[y[j]+k].substr(x[j]+29*i, 7);

                if(j == 3)
                    rotate(t);
                if(j == 1){
                    rotate(t);
                    rotate(t);
                    rotate(t);
                }
                turnX(t);
                if(j == 5)
                    turnY(t);
                
                while(t != vector<string>(pip[n[i][j]], pip[n[i][j]]+7))
                    ++ n[i][j];
            }
        }

        int ret = 0;
        for(int i=0; i<6; ++i){
            for(int j=0; j<6; ++j){
                if(n[0][i] > n[1][j])
                    ++ ret;
                if(n[0][i] < n[1][j])
                    -- ret;
            }
        }

        if(ret >= 0)
            cout << "HIGH" << endl;
        else
            cout << "LOW" << endl;
    }
}

Measured memory_bytes: 0