#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 <cstring>
#include <queue>
#include <sys/time.h>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rev(i,n) for(int i=(int)n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SS stringstream
#define bitcount(b) __builtin_popcount(b)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)

#define delete(a,n) a.erase(remove(all(a),n),a.end())
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ( (a)/__gcd((a),(b))*(b) )

template<typename T, typename S> vector<T>& operator<<(vector<T>& a, S b) { a.push_back(b); return a; }
template<typename T> void operator>>(vector<T>& a, int b) {while(b--)if(!a.empty())a.pop_back();}
bool isprime(int n){ if(n<2)return false;  for(int i=2;i*i<=n;i++)if(n%i==0)return false;  return true;} 
ll b_pow(ll x,ll n){return n ? b_pow(x*x,n/2)*(n%2?x:1) : 1ll;}
string itos(int n){stringstream ss;ss << n;return ss.str();}

char table[9][7][8] = {
{"#######",
"#.....#",
"#...|.#",
"#.....#",
"#...|.#",
"#..-..#",
"#######"}
,
{"#######",
"#..-..#",
"#...|.#",
"#..-..#",
"#.|...#",
"#..-..#",
"#######"}
,
{"#######",
"#..-..#",
"#...|.#",
"#..-..#",
"#...|.#",
"#..-..#",
"#######"}
,
{"#######",
"#.....#",
"#.|.|.#",
"#..-..#",
"#...|.#",
"#.....#",
"#######"}
,
{"#######",
"#..-..#",
"#.|...#",
"#..-..#",
"#...|.#",
"#..-..#",
"#######"}
,
{"#######",
"#..-..#",
"#.|...#",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#######"}
,
{"#######",
"#..-..#",
"#...|.#",
"#.....#",
"#...|.#",
"#.....#",
"#######"}
,
{"#######",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#######"}
,
{"#######",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#...|.#",
"#..-..#",
"#######"}
};

char h[100][100];

int lr(int x,int y){
	for(int i = 0 ; i < 7 ; i++){
		for(int j = 0 ; j < 3 ; j++){
			swap(h[y+i][x+j],h[y+i][x+6-j]);
		}
	}
}
int ud(int x,int y){
	for(int i = 0 ; i < 7 ; i++){
		for(int j = 0 ; j < 3 ; j++){
			swap(h[y+j][x+i],h[y+6-j][x+i]);
		}
	}
}
int d90(int x,int y){
	
	for(int i = 0 ; i < 7 ; i++){
		for(int j = 0 ; j < i ; j++){
			swap(h[y+i][x+j],h[y+j][x+i]);
		}
	}
	lr(x,y);
}

int swaper(int x,int y){
	for(int i = 0 ; i < 7 ; i++){
		for(int j = 0 ; j < 7 ; j++){
			if(h[y+i][x+j] == '-')h[y+i][x+j] = '|';
			else if(h[y+i][x+j] == '|')h[y+i][x+j] = '-';
		}
	}
}
int check(int x,int y){
	rep(i,9){
		bool f = true;
		rep(Y,7){
			rep(X,7){
				int xx = X + x;
				int yy = Y + y;
				//if(i==0)cout << h[yy][xx];
				f &= h[yy][xx] == table[i][Y][X];
			}
			//if(i==0)cout << endl;
		}
		if(f) return i+1;
	}
	return -1;
}
int main(){
	
	string s;
	while(1){
		rep(i,21)rep(j,57){
			char c; cin >> c;
			if(c == '0')return 0;
			h[i][j] = c;
		}
		vector<int> hide,ojisan;
		vector< pair<int,int> > a;
		vector< pair<int,int> > b;
		//cout << check(7,0) << endl;
		a << mp(0,7) << mp(7,0) << mp(7,7) << mp(7,14) << mp(7,21) << mp(14,7);
		b << mp(0,36) << mp(7,29) << mp(7,36) << mp(7,43) << mp(7,50) << mp(14,36);
		rep(i,a.size()){
			int x = a[i].second;
			int y = a[i].first;
			if(i==0)lr(x,y);
			if(i==1)lr(x,y),d90(x,y),d90(x,y),d90(x,y),swaper(x,y);
			if(i==2)lr(x,y);
			if(i==3)lr(x,y),d90(x,y),swaper(x,y);
			if(i==4)lr(x,y);
			if(i==5)ud(x,y),lr(x,y);
		}
		rep(i,b.size()){
			int x = b[i].second;
			int y = b[i].first;
			if(i==0)lr(x,y);
			if(i==1)lr(x,y),d90(x,y),d90(x,y),d90(x,y),swaper(x,y);
			if(i==2)lr(x,y);
			if(i==3)lr(x,y),d90(x,y),swaper(x,y);
			if(i==4)lr(x,y);
			if(i==5)ud(x,y),lr(x,y);
		}
		rep(i,a.size())hide.push_back(check(a[i].second,a[i].first)); 
		rep(i,b.size())ojisan.push_back(check(b[i].second,b[i].first));

		int w = 0 , l = 0;
		for(int i = 0 ; i < 6 ; i++){
			for(int j = 0 ; j < 6 ; j++){
				if(ojisan[j] == hide[i])continue;
				else if(ojisan[j] > hide[i]){
					l++;
				}else{
					w++;
				}
			}
		}
		if(w == l) cout << "HIGH";
		else if(w<l) cout << "LOW";
		else cout << "HIGH";
		cout << endl;
	}
}

Measured memory_bytes: 0