頭を悩ます (あたまをなやます) — to rack one's brains | Kumi Dictionary