Valmiki Ramayana Ayodhya Kanda Sarga 106 Shloka 4
Original Shlokaयथा मृत स्तथा जीवन्यथाऽसति तथा सति। यस्यैष बुद्धिलाभ स्स्यात्परितप्येत केन सः।।2.106.4।।
1 source checked for this shloka
मृतः the dead, यथा as, जीवन् while living, तथा in the same way, असति about evil man, यथा same way सति about virtuous man, तथा like that, यस्य to whom, एषः this, बुद्धिलाभः gains of intellect, स्यात् becomes, सः he, केन by what, परितप्येत is distressed.
One should accept life and death, vice and virtue equally. How can one be afflicted when he has gained such an intellect?