वालिनो मे भयार्तस्य सर्वलोकाभयंकर
ममापि त्वमनाथस्य प्रसादं कर्तुमर्हसि
एवमुक्तस्तु तेजस्वी धर्मज्ञो धर्मवत्सलः
प्रत्युवाच स काकुत्स्थः सुग्रीवं प्रहसन्निव
उपकारफलं मित्रमपकारो अरिलक्षणं
अद्यैव तं हनिष्यामि तव भार्यापहारिणं
vAlino me
BayArtasya sarvalokABayaMkara
mamApi
tvamanAthasya prasAdaM kartumarhasi
evamuktastu
tejasvI dharmaj~jo dharmavatsalaH
pratyuvAca
sa kAkutsthaH sugrIvaM prahasanniva upakAraPalaM
mitramapakAro arilakShaNaM adyaiva
taM haniShyAmi tava BAryApahAriNaM
Frightened Sugreeva sought with Rama asking that Vali is a Terror to the world and since you too are an orphan just like me, please give me a boon for my protection. Rama, who is in the clan of kakutstha, the enlightened, the righteous and one who blooms righteousness, replied back that had hope and happiness in Sugriva that the fruit of helping is a friend and the bad doer is an enemy. Hence I'll kill him who has kidnapped your wife.
The above verses are available in the 8th sarga of the Kishkindakanda in Maharshi Valmiki's Ramayana. Sugreeva after understanding the power of Rama, begs him to help him by mentioning how dangerous his brother is and how he unrightfully has taken away everything from him (including his wife). Rama after listening to him mentions about who is a good friend and what constitutes an enemy and having said that he states that kidnapping one's wife is a cruel offense and an unrightful act and hence he will kill Vali.