Valmiki Ramayana Sundara Kanda Sarga 48 Shloka 42
Original Shlokaस वीर्यमस्त्रस्य कपिर्विचार्य पितामहानुग्रहमात्मनश्च। विमोक्षशक्तिं परिचिन्तयित्वा पितामहाज्ञामनुवर्तते स्म।।5.48.42।।
1 source checked for this shloka
सः कपिः that Hanuman, अस्त्रस्य astra's, वीर्यम् power, विचार्य reflecting, आत्मनः in himself, पितामहानुग्रहं च by the favour of Brahma, विमोक्षशक्तिम् the power of liberation from bondage, परिचिन्तयित्वा recalling about, पितामहाज्ञाम् by the order of Brahma, अनुवर्तते स्म he obeyed
Reflecting within himself about the power of the astra, Hanuman recalled Braham's favour to him. He recalled his own power to liberate himself from the Brahmastra and resolved to abide by the order of Brahma.