Valmiki Ramayana Ayodhya Kanda Sarga 99 Shloka 34
Original Shlokaयस्य यज्ञैर्यथादिष्टैर्युक्तो धर्मस्य सञ्चयः। शरीरक्लेशसम्भूतं स धर्मं परिमार्गते।।2.99.34।।
1 source checked for this shloka
यथोद्विष्टैः in accordance with desire, यज्ञैः with sacrifices, यस्य to whom, धर्मस्य righteousness, सञ्चयः accumulation, युक्तः was quite possible, सः such Rama, शरीरक्लेशसंभूतम् rising due to mortification of body, धर्मम् righteouness, परिमार्गते is seeking.
That Rama, who in accordance with tradition deserves accredition of religious merit through sacrifices now seeks it through mortification of body.