jì​qióng​zhì​duǎn

at one's wits' end