#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

vector<string> rightRotate(vector<string> vs){
    vector<string> ns;
    for(int i = 0; i < vs[0].size(); i++){
        string str;
        for(int j = vs.size()-1; j>=0; j--){
            str+=vs[j][i];
        }
        ns.push_back(str);
    }
    return ns;
}
vector<string> leftRotate(vector<string> vs){
    vector<string> ns;
    for(int i = vs[0].size()-1; i >= 0; i--){
        string str;
        for(int j = 0; j < vs.size(); j++){
            str+=vs[j][i];
        }
        ns.push_back(str);
    }
    return ns;
}
void UpDownFlip(vector<string> &vs){
    for(int i = 0; i < vs.size()/2; i++)
        swap(vs[i],vs[vs.size()-1-i]);
}
void LeftRightFlip(vector<string> &vs){
    for(int j = 0; j < vs[0].size()/2; j++)
        for(int i = 0; i < vs.size(); i++)
            swap(vs[i][j],vs[i][vs.size()-1-j]);
}
int getNum(vector<string> vs){
    bool b[7];
    fill(b,b+7,false);
    if(vs[1][3]!='.')b[0]=true;
    if(vs[2][2]!='.')b[1]=true;
    if(vs[2][4]!='.')b[2]=true;
    if(vs[3][3]!='.')b[3]=true;
    if(vs[4][2]!='.')b[4]=true;
    if(vs[4][4]!='.')b[5]=true;
    if(vs[5][3]!='.')b[6]=true;
    if(b[2]&&b[5]&&!b[0]&&!b[1]&&!b[3]&&!b[4]&&b[6])
        return 1;
    else if(b[2]&&!b[5]&&b[0]&&!b[1]&&b[3]&&b[4]&&b[6])
        return 2;
    else if(b[2]&&b[5]&&b[0]&&!b[1]&&b[3]&&!b[4]&&b[6])
        return 3;
    else if(b[2]&&b[5]&&!b[0]&&b[1]&&b[3]&&!b[4]&&!b[6])
        return 4;
    else if(!b[2]&&b[5]&&b[0]&&b[1]&&b[3]&&!b[4]&&b[6])
        return 5;
    else if(!b[2]&&b[5]&&b[0]&&b[1]&&b[3]&&b[4]&&b[6])
        return 6;
    else if(b[2]&&b[5]&&b[0]&&!b[1]&&!b[3]&&!b[4]&&!b[6])
        return 7;
    else if(b[2]&&b[5]&&b[0]&&b[1]&&b[3]&&b[4]&&b[6])
        return 8;
    else if(b[2]&&b[5]&&b[0]&&b[1]&&b[3]&&!b[4]&&b[6])
        return 9;
}
void solve(){
    int b=0;
    while(1){
        vector<int> o,c;
        vector<string> vs1,vs2;
        // êÂÚ
        for(int i = 0; i < 7; i++){
            string str;
            getline(cin,str);
            if(str=="0")
                return;
            vs1.push_back(str.substr(7,7));
            vs2.push_back(str.substr(36,7));
        }
        LeftRightFlip(vs1);LeftRightFlip(vs2);
        o.push_back(getNum(vs1));
        c.push_back(getNum(vs2));
        vs1.clear();vs2.clear();
        // 2-4Ú
        vector<string> vss1[4];
        vector<string> vss2[4];
        for(int i = 0; i < 7; i++){
            string str;
            getline(cin,str);
            for(int i = 0; i < 4; i++)
                vss1[i].push_back(str.substr(i*7,7));
            for(int i = 0; i < 4; i++)
                vss2[i].push_back(str.substr(29+i*7,7));
        }
        // êÂ¸Âi[
        for(int i = 0; i < 4; i++){
            if(i==0){
                vss1[i]=rightRotate(vss1[i]);
                vss2[i]=rightRotate(vss2[i]);
                LeftRightFlip(vss1[i]);
                LeftRightFlip(vss2[i]);
            }
            else if(i==1){
                LeftRightFlip(vss1[i]);
                LeftRightFlip(vss2[i]);
            }
            else if(i==2){
                vss1[i]=leftRotate(vss1[i]);
                vss2[i]=leftRotate(vss2[i]);
                LeftRightFlip(vss1[i]);
                LeftRightFlip(vss2[i]);
            }
            else if(i==3){
                LeftRightFlip(vss1[i]);
                LeftRightFlip(vss2[i]);
            }
            o.push_back(getNum(vss1[i]));
            c.push_back(getNum(vss2[i]));
        }
        // 5,6Ú
        for(int j = 0; j < 1; j++){
            for(int i = 0; i < 7; i++){
                string str;
                getline(cin,str);
                vs1.push_back(str.substr(7,7));
                vs2.push_back(str.substr(36,7));
            }
            UpDownFlip(vs1);UpDownFlip(vs2);
            LeftRightFlip(vs1);LeftRightFlip(vs2);
            o.push_back(getNum(vs1));
            c.push_back(getNum(vs2));
            vs1.clear();vs2.clear();
        }
        sort(o.begin(),o.end());
        sort(c.begin(),c.end());
        swap(o,c);
        int sum=0;
        int bunbo=0;
        for(int i = 0; i < c.size(); i++){
            for(int j = 0; j < o.size(); j++){
                if(o[j]<c[i]){
                    sum++;
                    bunbo++;
                }
                else if(o[j]!=c[i])
                    bunbo++;
            }
        }
        if(sum>=bunbo/2+bunbo%2)
            cout<<"HIGH"<<endl;
        else
            cout<<"LOW"<<endl;
        b++;
    }
}

int main(){

    solve();

    return 0;
}

Measured memory_bytes: 0