#include<iostream>
#include<algorithm>
using namespace std;

char p[6][7][7],o[6][7][7];
string grid[21];

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

void lr_change(int a){
  for(int i=0;i<7;i++){
    for(int j=0;j<3;j++){
      swap(p[a][i][j],p[a][i][6-j]);
      swap(o[a][i][j],o[a][i][6-j]);
    }
  }
}

void ud_change(int a){
  for(int i=0;i<7;i++){
    for(int j=0;j<3;j++){
      swap(p[a][j][i],p[a][6-j][i]);
      swap(o[a][j][i],o[a][6-j][i]);
    }
  }
}

void l_rot(int a){
  string tmp1[7],tmp2[7];
  for(int i=0;i<7;i++){
    for(int j=0;j<7;j++){
      if(p[a][j][6-i] == '-'){
	tmp1[i].push_back('|');
      }else if(p[a][j][6-i] == '|'){
	tmp1[i].push_back('-');
      }else{
	tmp1[i].push_back(p[a][j][6-i]);
      }
      if(o[a][j][6-i] == '-'){
	tmp2[i].push_back('|');
      }else if(o[a][j][6-i] == '|'){
	tmp2[i].push_back('-');
      }else{
	tmp2[i].push_back(o[a][j][6-i]);
      }
    }
  }
  for(int i=0;i<7;i++){
    for(int j=0;j<7;j++){
      p[a][i][j] = tmp1[i][j];
      o[a][i][j] = tmp2[i][j];
    }
  } 
}

void r_rot(int a){
  string tmp1[7],tmp2[7];
  for(int i=0;i<7;i++){
    for(int j=0;j<7;j++){
      if(p[a][6-j][i] == '-'){
	tmp1[i].push_back('|');
      }else if(p[a][6-j][i] == '|'){
	tmp1[i].push_back('-');
      }else{
	tmp1[i].push_back(p[a][6-j][i]);
      }

      if(o[a][6-j][i] == '-'){
	tmp2[i].push_back('|');
      }else if(o[a][6-j][i] == '|'){
	tmp2[i].push_back('-');
      }else{
	tmp2[i].push_back(o[a][6-j][i]);
      }
    }
  }
  for(int i=0;i<7;i++){
    for(int j=0;j<7;j++){
      p[a][i][j] = tmp1[i][j];
      o[a][i][j] = tmp2[i][j];
    }
  } 
}


int main(){
  int num[2][6];

  while(1){
    cin >> grid[0];
    if(grid[0] == "0")break;

    for(int i=1;i<21;i++)cin >> grid[i];

    for(int i=0;i<7;i++){
      for(int j=0;j<7;j++){
	p[0][i][j] = grid[i][j+7];
	p[1][i][j] = grid[i+7][j];
	p[2][i][j] = grid[i+7][j+7];
	p[3][i][j] = grid[i+7][j+14];
	p[4][i][j] = grid[i+7][j+21];
	p[5][i][j] = grid[i+14][j+7];

	o[0][i][j] = grid[i][j+36];
	o[1][i][j] = grid[i+7][j+29];
	o[2][i][j] = grid[i+7][j+36];
	o[3][i][j] = grid[i+7][j+43];
	o[4][i][j] = grid[i+7][j+50];
	o[5][i][j] = grid[i+14][j+36];
      }
    }
    lr_change(0);

    r_rot(1);
    lr_change(1);

    lr_change(2);

    l_rot(3);
    lr_change(3);

    lr_change(4);

    ud_change(5);
    lr_change(5);
    
    for(int i=0;i<6;i++){
      for(int j=0;j<9;j++){
	bool fp = true,fo = true;;
	for(int k=0;k<7;k++){
	  for(int l=0;l<7;l++){
	    if(f[j][k][l] != p[i][k][l])fp = false;
	    if(f[j][k][l] != o[i][k][l])fo = false;
	  }
	}
	if(fp)num[0][i] = j+1;
	if(fo)num[1][i] = j+1;
      }
    }
    int h=0,l=0;
    for(int i=0;i<6;i++){
      for(int j=0;j<6;j++){
	if(num[0][i] < num[1][j])l++;
	if(num[0][i] > num[1][j])h++;
      }
    }

    if(l>h)cout << "LOW" << endl;
    else cout << "HIGH" << endl;
  }
}

Measured memory_bytes: 0