Valmiki Ramayana Sundara Kanda Sarga 53 Shloka 10
Original Shlokaस भूयः सङ्गतैः क्रूरैर्राक्षसैर्हरिसत्तमः।।5.53.10।। निबद्धः कृतवान्वीरस्तत्कालसदृशीं मतिम्।
1 source checked for this shloka
वीरः hero, सः हरिसत्तमः that great monkey, सङ्गतैः (ogres) collected around him, क्रूरैः cruel, राक्षसैः with ogres, भूयः again, निबद्धः bound, तत्कालसदृशीम् appropriate to the moment, मतिम् thought, कृतवान् thought over thus.
When the cruel demons collected together and bound him once again the heroic Hanuman thought what was appropriate to the moment.