#include<cstdio>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

const char PTTN[9][5][6]={
{
	".....",
	"...|.",
	".....",
	"...|.",
	"..-.."
},{
	"..-..",
	"...|.",
	"..-..",
	".|...",
	"..-.."
},{
	"..-..",
	"...|.",
	"..-..",
	"...|.",
	"..-.."
},{
	".....",
	".|.|.",
	"..-..",
	"...|.",
	"....."
},{
	"..-..",
	".|...",
	"..-..",
	"...|.",
	"..-.."
},{
	"..-..",
	".|...",
	"..-..",
	".|.|.",
	"..-.."
},{
	"..-..",
	"...|.",
	".....",
	"...|.",
	"....."
},{
	"..-..",
	".|.|.",
	"..-..",
	".|.|.",
	"..-.."
},{
	"..-..",
	".|.|.",
	"..-..",
	"...|.",
	"..-.."
}};

void flipLR(char face[5][5]){
	rep(i,5) rep(j,2) swap(face[i][j],face[i][4-j]);
}

void flipUD(char face[5][5]){
	rep(i,2) rep(j,5) swap(face[i][j],face[4-i][j]);
}

void rot90(char face[5][5]){
	static int g[128];
	g['|']='-'; g['-']='|'; g['.']='.';

	char tmp[5][5];
	rep(i,5) rep(j,5) tmp[4-j][i]=g[face[i][j]];

	rep(i,5) rep(j,5) face[i][j]=tmp[i][j];
}

void f(char face[5][5],int k){
	switch(k){
		case 0:
		case 2:
		case 4:
			flipLR(face);
			break;
		case 1:
			flipLR(face);
			rot90(face);
			break;
		case 3:
			flipLR(face);
			rot90(face); rot90(face); rot90(face);
			break;
		case 5:
			flipUD(face);
			flipLR(face);
			break;
	}
}

void parse(const char die[21][28],int num[6]){
	// upper left coordinate
	const int ul[6][2]={{0,7},{7,0},{7,7},{7,14},{7,21},{14,7}};

	rep(k,6){
		int t=ul[k][0]+1,l=ul[k][1]+1;
		rep(d,9){
			char face[2][5][5];
			rep(i,5) rep(j,5) {
				face[0][i][j]=die[i+t][j+l];
				face[1][i][j]=PTTN[d][i][j];
			}
			f(face[1],k);

			bool eq=true;
			rep(i,5) rep(j,5) if(face[0][i][j]!=face[1][i][j]) eq=false;
			if(eq){ num[k]=d+1; break; }
		}
	}
}

int main(){
	while(1){
		char die[2][21][28];
		rep(i,21){
			char s[58]; scanf("%s",s);
			rep(j,28){
				die[0][i][j]=s[j];
				die[1][i][j]=s[j+29];
			}
		}
		if(die[0][0][0]=='0') break;

		int num[2][6];
		rep(k,2) parse(die[k],num[k]);

		int win=0,tot=0;
		rep(i,6) rep(j,6) {
			if(num[0][i]> num[1][j]) win++;
			if(num[0][i]!=num[1][j]) tot++;
		}
		puts(2*win>=tot?"HIGH":"LOW");
	}

	return 0;
}