dān​sī​jí​lǜ

to rack one's brains