殚精竭虑

dān jīng jié lǜ

to exhaust one's thoughts and ingenuity (idiom); to think sth through thoroughly

to rack one's brains; to leave no stone unturned

殚

dān

entirely

精

jīng

essence

竭

jié

to exhaust

虑

lǜ

to think over