#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
#include <list>
#include <ctime>
#include <numeric>
using namespace std;
static const double EPS = 1e-6;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PI;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SZ(a) (int(a.size()))
#define F first
#define S second
const double pi=acos(-1);
int dx[]={0,1,0,-1,1,1,-1,-1},dy[]={1,0,-1,0,1,-1,1,-1};

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

string in[100];
int sx[]={0,7,7,7,7,14},sy[]={7,0,7,14,21,7};

bool eq(char a,char b){
  if(a==b)return true;
  if((a=='|' || a=='-') && (b=='|' || b=='-'))return true;
  return false;
}

int get(int p,int po){
  rep(i,9){
    bool ok=true;
    rep(j,7)rep(k,7){
      if(!eq(num[i][j][k],in[sx[po]+j][p*29+sy[po]+k])){
        ok=false;
      }
    }
    if(ok)return i+1;
  }
}

main(){
  while(true){
    cin>>in[0];
    if(in[0][0]=='0')break;
    rep(i,20)cin>>in[i+1];


    rep(i,2){
      rep(j,6){
        rep(k,7){
          rep(l,3)swap(in[sx[j]+k][i*29+sy[j]+l],in[sx[j]+k][i*29+sy[j]+6-l]);
        }
      }
    }
    rep(i,2){
      char han[7][7];
      rep(j,7)rep(k,7)han[6-k][j]=in[7+j][i*29+k];
      rep(j,7)rep(k,7)in[7+j][i*29+k]=han[j][k];
    }
    rep(i,2){
      char han[7][7];
      rep(j,7)rep(k,7)han[k][6-j]=in[7+j][i*29+14+k];
      rep(j,7)rep(k,7)in[7+j][i*29+14+k]=han[j][k];
    }
    rep(i,2){
      rep(j,3)rep(k,7)swap(in[14+j][i*29+7+k],in[14+6-j][i*29+7+k]);
    }

    int si[2][6];
    rep(i,2){
      rep(j,6){
        si[i][j]=get(i,j);
        //cout<<si[i][j]<<' ';
      }
      //cout<<endl;
    }
    int w=0,l=0;
    rep(j,6)rep(i,6){
      if(si[0][j]>si[1][i])++w;
      if(si[0][j]<si[1][i])++l;
    }
    if(w>=l)cout<<"HIGH"<<endl;
    else cout<<"LOW"<<endl;
  }
}

Measured memory_bytes: 0