fun main(args: Array<String>?): Unit {
    while(true){
        val firstLine = readLine()!!.trim()
        if (firstLine == "0") break
        val dice = (0 until 21).map{if (it == 0) firstLine else readLine()!!.trim()}
        val self = Dice(dice.map{line -> (0 until 28).map{w -> line[w]}})
        val ossan = Dice(dice.map{line -> (29 until 57).map{w -> line[w]}})
        println(judge(self, ossan))
    }
}
fun judge(self: Dice, ossan: Dice): String {
    val win = self.faces.map{s -> ossan.faces.count{o -> s > o}}.sum()
    val lose = self.faces.map{s -> ossan.faces.count{o -> s < o}}.sum()
    return if (win >= lose) "HIGH" else "LOW"
}

class Dice(list: List<List<Char>>) {
    val faces: List<Int> = parse(list)
    companion object {
        private val default = listOf(
                    """########.....##...|.##.....##...|.##..-..########""",
                    """########..-..##...|.##..-..##.|...##..-..########""",
                    """########..-..##...|.##..-..##...|.##..-..########""",
                    """########.....##.|.|.##..-..##...|.##.....########""",
                    """########..-..##.|...##..-..##...|.##..-..########""",
                    """########..-..##.|...##..-..##.|.|.##..-..########""",
                    """########..-..##...|.##.....##...|.##.....########""",
                    """########..-..##.|.|.##..-..##.|.|.##..-..########""",
                    """########..-..##.|.|.##..-..##...|.##..-..########"""
        ).map{str -> Image((0 until 7).map{str.substring(7 * it, 7 * it + 7).toList()})}
        private val leftTop = listOf(
                Pair(0, 7), Pair(7, 0), Pair(7, 7), Pair(7, 14), Pair(7, 21), Pair(14, 7)
        )
        private val changeFace = listOf<(Image) -> Image>(
                Image::flipV,
                {it.flipV().rotateL()},
                Image::flipV,
                {it.flipV().rotateR()},
                Image::flipV,
                {it.flipH().flipV()}
        )
        private fun parse(list: List<List<Char>>): List<Int> {
            return (0 until 6).map{face ->
                val f = (0 until 7).map{y -> (0 until 7).map{x -> list[leftTop[face].first + y][leftTop[face].second + x]}}
                val d = default.map(changeFace[face])
                d.indexOfFirst { image ->
                    (0 until 7).all {y -> (0 until 7).all{x -> f[y][x] == image[x, y]} }
                }
            }.sorted()
        }
    }
}

interface Image {
    operator fun get(x: Int, y: Int): Char
    fun flipV(): Image = FlipV(this)
    fun flipH(): Image = FlipH(this)
    fun rotateR(): Image = RotateR(this)
    fun rotateL(): Image = RotateL(this)
    val height: Int
    val width: Int
    companion object{
        operator fun invoke(list: List<List<Char>>): Image {
            return Pure(list)
        }
        class Pure(private val list: List<List<Char>>): Image {
            override fun get(x: Int, y: Int): Char {
                return list[y][x]
            }
            override val height: Int
                get() = list.size
            override val width: Int
                get() = list.first().size
        }
    }
}
class FlipV(private val base: Image): Image {
    override fun get(x: Int, y: Int): Char {
        return base[base.width - x - 1, y]
    }
    override val height: Int
        get() = base.height
    override val width: Int
        get() = base.width
}
class FlipH(private val base: Image): Image {
    override fun get(x: Int, y: Int): Char {
        return base[x, base.height - y - 1]
    }
    override val height: Int
        get() = base.height
    override val width: Int
        get() = base.width
}
class RotateR(private val base: Image): Image {
    override fun get(x: Int, y: Int): Char {
        return base[y, base.height - x - 1].let{when(it){
            '|' -> '-'
            '-' -> '|'
            else -> it
        } }
    }
    override val height: Int
        get() = base.width
    override val width: Int
        get() = base.height
}
class RotateL(private val base: Image): Image {
    override fun get(x: Int, y: Int): Char {
        return base[base.width - y - 1, x].let{when(it){
            '|' -> '-'
            '-' -> '|'
            else -> it
        } }
    }
    override val height: Int
        get() = base.width
    override val width: Int
        get() = base.height
}


Measured memory_bytes: 46044