This is the 11989th most frequent Polish word.
lamia
"Lamia" in Polish refers to a mythical creature, often a monster or witch that devours people.
Here 'łamią' should be presumably 'Lamia', referring to a mythical Greek creature.
Czytałem książkę o greckiej łamią, która porywała dzieci.
I read a book about the Greek Lamia who kidnapped children.
In this case, 'łamią' is part of an idiomatic expression meaning 'rack their brains' or 'think hard'.
Uczniowie łamią sobie głowy nad trudnym zadaniem z matematyki.
The students rack their brains over a difficult math problem.
The word 'łamią' means 'break', used here to indicate breaking rules.