#include<stdio.h>
#include<algorithm>
using namespace std;
char str[60][60];
int x[]={0,7,7,7,7,14};
int y[]={7,0,7,14,21,7};
char pt[9][10][10]={
{
"#######",
"#.....#",
"#...|.#",
"#.....#",
"#...|.#",
"#..-..#",
"#######"
},{
"#######",
"#..-..#",
"#...|.#",
"#..-..#",
"#.|...#",
"#..-..#",
"#######"
},{
"#######",
"#..-..#",
"#...|.#",
"#..-..#",
"#...|.#",
"#..-..#",
"#######"
},{
"#######",
"#.....#",
"#.|.|.#",
"#..-..#",
"#...|.#",
"#.....#",
"#######"
},{
"#######",
"#..-..#",
"#.|...#",
"#..-..#",
"#...|.#",
"#..-..#",
"#######"
},{
"#######",
"#..-..#",
"#.|...#",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#######"
},{
"#######",
"#..-..#",
"#...|.#",
"#.....#",
"#...|.#",
"#.....#",
"#######"
},{
"#######",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#######"
},{
"#######",
"#..-..#",
"#.|.|.#",
"#..-..#",
"#...|.#",
"#..-..#",
"#######"
}};
int b[10];
int c[10];
char to[10][10];
int main(){
	while(1){
		scanf("%s",str[0]);
		if(str[0][0]=='0')break;
		for(int i=1;i<21;i++)scanf("%s",str[i]);
		for(int i=0;i<6;i++){
			for(int j=0;j<7;j++)for(int k=0;k<3;k++){
				swap(str[x[i]+j][y[i]+k],str[x[i]+j][y[i]+6-k]);
			}
			if(i==1){
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					to[6-k][j]=str[x[i]+j][y[i]+k];
				}
			//	for(int j=0;j<7;j++)printf("%s\n",to[j]);
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					if(to[j][k]=='-')to[j][k]='|';
					else if(to[j][k]=='|')to[j][k]='-';
					str[x[i]+j][y[i]+k]=to[j][k];
				}
			}
			if(i==3){
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					to[k][6-j]=str[x[i]+j][y[i]+k];
				}
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					if(to[j][k]=='-')to[j][k]='|';
					else if(to[j][k]=='|')to[j][k]='-';
					str[x[i]+j][y[i]+k]=to[j][k];
				}
			}
			if(i==5){
				for(int j=0;j<3;j++)for(int k=0;k<7;k++){
					swap(str[x[i]+j][y[i]+k],str[x[i]+6-j][y[i]+k]);
				}
			}
			for(int j=0;j<9;j++){
				bool ok=true;
				for(int k=0;k<7;k++)for(int l=0;l<7;l++)
					if(str[x[i]+k][y[i]+l]!=pt[j][k][l])ok=false;
				if(ok)b[i]=j;
			}
		}
		for(int i=0;i<6;i++)y[i]+=29;
		for(int i=0;i<6;i++){
			for(int j=0;j<7;j++)for(int k=0;k<3;k++){
				swap(str[x[i]+j][y[i]+k],str[x[i]+j][y[i]+6-k]);
			}
			if(i==1){
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					to[6-k][j]=str[x[i]+j][y[i]+k];
				}
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					if(to[j][k]=='-')to[j][k]='|';
					else if(to[j][k]=='|')to[j][k]='-';
					str[x[i]+j][y[i]+k]=to[j][k];
				}
			}
			if(i==3){
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					to[k][6-j]=str[x[i]+j][y[i]+k];
				}
				for(int j=0;j<7;j++)for(int k=0;k<7;k++){
					if(to[j][k]=='-')to[j][k]='|';
					else if(to[j][k]=='|')to[j][k]='-';
					str[x[i]+j][y[i]+k]=to[j][k];
				}
			}
			if(i==5){
				for(int j=0;j<3;j++)for(int k=0;k<7;k++){
					swap(str[x[i]+j][y[i]+k],str[x[i]+6-j][y[i]+k]);
				}
			}
			for(int j=0;j<9;j++){
				bool ok=true;
				for(int k=0;k<7;k++)for(int l=0;l<7;l++)
					if(str[x[i]+k][y[i]+l]!=pt[j][k][l])ok=false;
				if(ok)c[i]=j;
			}
		}
		//for(int i=0;i<21;i++)printf("%s\n",str[i]);
		//for(int i=0;i<6;i++)printf("%d %d\n",b[i],c[i]);
		for(int i=0;i<6;i++)y[i]-=29;
		int L=0;
		int H=0;
		for(int i=0;i<6;i++)for(int j=0;j<6;j++){if(b[i]>c[j])H++;if(b[i]<c[j])L++;}
		if(L>H)printf("LOW\n");
		else printf("HIGH\n");
	}
}

Measured memory_bytes: 948