When Lord Hanuman was on his way to Lanka, Surasa, who assumed the form of a demoness, blocked his way. And she did not just block Lord Hanuman’s way, she also claimed that Lord Hanuman would have to pass through her mouth to reach Lanka.
And at that time, Lord Hanuman first enlarged his form, due to which Surasa too had to quickly expand her mouth. After that, Lord Hanuman in an instant shrunk himself, entered her mouth, and before she could shut it, made an exit and flew away to rescue Mata Sita.
And so, a mix of brains and quick wits help in the toughest situations.