qián​lǘ​jì​qióng

to reach the end of one's wits