Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count etc.
#include <cstdlib>	// require abs
#include <cstdio>	// require printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>	// require tolower, toupper
#include <fstream>	// require freopen

using namespace std;
const string num[10][7] = {
{
	{"#######"},
	{"#.....#"},
	{"#...|.#"},
	{"#.....#"},
	{"#...|.#"},
	{"#..-..#"},
	{"#######"}
},{
	{"#######"},
	{"#..-..#"},
	{"#...|.#"},
	{"#..-..#"},
	{"#.|...#"},
	{"#..-..#"},
	{"#######"}
},{
	{"#######"},
	{"#..-..#"},
	{"#...|.#"},
	{"#..-..#"},
	{"#...|.#"},
	{"#..-..#"},
	{"#######"}
},{
	{"#######"},
	{"#.....#"},
	{"#.|.|.#"},
	{"#..-..#"},
	{"#...|.#"},
	{"#.....#"},
	{"#######"}
},{
	{"#######"},
	{"#..-..#"},
	{"#.|...#"},
	{"#..-..#"},
	{"#...|.#"},
	{"#..-..#"},
	{"#######"}
},{
	{"#######"},
	{"#..-..#"},
	{"#.|...#"},
	{"#..-..#"},
	{"#.|.|.#"},
	{"#..-..#"},
	{"#######"}
},{
	{"#######"},
	{"#..-..#"},
	{"#...|.#"},
	{"#.....#"},
	{"#...|.#"},
	{"#.....#"},
	{"#######"}
},{
	{"#######"},
	{"#..-..#"},
	{"#.|.|.#"},
	{"#..-..#"},
	{"#.|.|.#"},
	{"#..-..#"},
	{"#######"}
},{
	{"#######"},
	{"#..-..#"},
	{"#.|.|.#"},
	{"#..-..#"},
	{"#...|.#"},
	{"#..-..#"},
	{"#######"}
}
};

char fig[21][57];

vector <string> updown (vector <string> str )
{
	vector <string> res (7, string (7, ' ') );
	for (int i = 0; i < 7; i++ ){
		for (int j = 0; j < 7; j++ ){
			res[i][j] = str[6-i][j];
		} // end for
	} // end for
	
	return res;
}

vector <string> symm (vector <string> str )
{
	vector <string> res (7 );

	int size = str.size();
	for (int i = 0; i < size; i++ ){
		reverse (str[i].begin(), str[i].end() );
		res[i] = str[i];
	} // end for

	return res;
}

vector <string>  rotate (vector <string> str )
{
	vector <string> temp (7, string (7, ' ') );
	vector <string> res (7, string (7, ' ') );
	
	for (int i = 0; i < 7; i++ ){
		for (int j = 0; j < 7; j++ ){
//			temp[i][j] = str[j][7-i-1];
			temp[j][7-i-1] = str[i][j];
		} // end for
	} // end for

	for (int i = 0;i < 7; i++ ){
		for (int j = 0; j < 7; j++ ){
			if (temp[i][j] != '-' && temp[i][j] != '|' ){
				res[i][j] = temp[i][j];
			}else if (temp[i][j] == '-' ){
				res[i][j] = '|';
			}else{	// if (temp[i][j] == '|' )
				res[i][j] = '-';
			} // end if
		} // end for
	} // end for

	return res;

}
vector <string>  rrotate (vector <string> str )
{
	vector <string> temp (7, string (7, ' ') );
	vector <string> res (7, string (7, ' ') );
	
	for (int i = 0; i < 7; i++ ){
		for (int j = 0; j < 7; j++ ){
			temp[i][j] = str[j][7-i-1];
//			temp[j][7-i-1] = str[i][j];
		} // end for
	} // end for

	for (int i = 0;i < 7; i++ ){
		for (int j = 0; j < 7; j++ ){
			if (temp[i][j] != '-' && temp[i][j] != '|' ){
				res[i][j] = temp[i][j];
			}else if (temp[i][j] == '-' ){
				res[i][j] = '|';
			}else{	// if (temp[i][j] == '|' )
				res[i][j] = '-';
			} // end if
		} // end for
	} // end for

	return res;

}
void disp_daisu (vector <string> str )
{
	for (int i = 0; i < 7; i++ ){
		for (int j = 0; j < 7; j++ ){
			cout << str[i][j];
		} // end for
		cout << endl;
	} // end for
	cout << endl;
}

int is_same (vector <string> str )
{
	for (int n = 0; n < 10; n++ ){
		bool found = true;
		for (int i = 0; i < 7; i++ ){
			for (int j = 0; j < 7; j++ ){
				if (str[i][j] == num[n][i][j] ){
					continue;
				}else{
					found = false;
					break;
				} // end for
			} // end for
			if (!found )
				break;
		} // end for
		if (found )
			return n;
	} // end for

	return -1;
}

int main()
{

//	cut here before submit 
	freopen ("testcase.HLC2", "r", stdin );
/*	
	for (int i = 0; i < 9; i++ ){
		for (int j = 0; j < 7; j++ ){
			for (int k = 0; k < 7; k++ ){
				cout << num[i][j][k];
			} // end for
			cout << endl;
		} // end for
		cout << endl;
	} // end for
*/
	const int mpos[][2] = { {0,7},{7,0},{7,7},{7,14},{7,21},{14,7} };
	const int ypos[][2] = { {0,36},{7,29},{7,36},{7,43},{7,50},{14,36} };

	while (1 ){
		memset (fig, 0, sizeof (fig ) );
		for (int i = 0; i < 21; i++ ){
			string in = "";
			cin >> in;
			if (in == "0" ){
				return 0;
			} // end if
			for (int j = 0; j < 57; j++ ){
				fig[i][j] = in[j];
			} // end for
		} // end for
		vector <vector <string> > me (6, vector <string> (7, string (7, ' ' ) ) );
		vector <vector <string> > you (6, vector <string> (7, string (7, ' ' ) ) );

		for (int i = 0; i < 6; i++ ){
			for (int j = mpos[i][0], j0 = 0; j0 <  7; j++,j0++ ){
				for (int k = mpos[i][1], k0 = 0; k0 < 7; k++, k0++ ){
					me[i][j0][k0] = fig[j][k];
				} // end for
			} // end for
		} // end for
		for (int i = 0; i < 6; i++ ){
			for (int j = ypos[i][0], j0 = 0; j0 <  7; j++,j0++ ){
				for (int k = ypos[i][1], k0 = 0; k0 < 7; k++, k0++ ){
					you[i][j0][k0] = fig[j][k];
				} // end for
			} // end for
		} // end for
		vector <int> menum (6, 0 ), younum (6, 0 );

		for (int i = 0; i < 6; i++ ){
			vector <string> curr = me[i];
			curr = symm (curr );
			curr = updown (curr );
			curr = symm (curr );
			menum[i] = is_same (curr ) + 1;
		} // end for

		for (int i = 0; i < 6; i++ ){
			vector <string> curr = you[i];
			curr = symm (curr );
			curr = updown (curr );
			curr = symm (curr );
			younum[i] = is_same (curr ) + 1;
		} // end for

		int summ = 0, sumy = 0;
		for (int i = 0; i < 6; i++ ){
			summ += menum[i];
			sumy += younum[i];

//			cout << menum[i] << ' ' << younum[i] << endl;
		} // end for
//		cout << summ << ' ' << sumy << endl;
		if (summ < sumy ){
			cout << "LOW" << endl;
		}else{
			cout << "HIGH" << endl;
		} // end if
/*	
		for (int i = 0; i < 6; i++ ){
			for (int j = 0; j < 7; j++ ){
				for (int k = 0; k < 7; k++ ){
					cout << me[i][j][k];
				} // end for
				cout << endl;
			} // end for
			cout << endl;
		} //end for
*/

/*
		for (int i = 0; i < 21; i++ ){
			for (int j = 0; j < 57; j++ ){
				cout << fig[i][j];
			} // end for
			cout << endl;
		} // end for
*/		
	} // end while


		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:271:36: error: reference to 'is_same' is ambiguous
  271 |                         menum[i] = is_same (curr ) + 1;
      |                                    ^~~~~~~
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits:780:12: note: candidates are: 'template<class, class> struct std::is_same'
  780 |     struct is_same;
      |            ^~~~~~~
a.cc:193:5: note:                 'int is_same(std::vector<std::__cxx11::basic_string<char> >)'
  193 | int is_same (vector <string> str )
      |     ^~~~~~~
a.cc:279:37: error: reference to 'is_same' is ambiguous
  279 |                         younum[i] = is_same (curr ) + 1;
      |                                     ^~~~~~~
/usr/include/c++/14/type_traits:780:12: note: candidates are: 'template<class, class> struct std::is_same'
  780 |     struct is_same;
      |            ^~~~~~~
a.cc:193:5: note:                 'int is_same(std::vector<std::__cxx11::basic_string<char> >)'
  193 | int is_same (vector <string> str )
      |     ^~~~~~~