Valmiki Ramayana Aranya Kanda Sarga 33 Shloka 20
Original Shlokaअप्रमत्तश्च यो राजा सर्वज्ञो विजितेन्द्रियः। कृतज्ञो धर्मशीलश्च स राजा तिष्ठते चिरम्।।3.33.20।।
1 source checked for this shloka
यः राजा such king, अप्रमत्तः alert, सर्वज्ञः omniscient, विजितेन्द्रियः has control over his senses, कृतज्ञः grateful, धर्मशीलश्च one with moral conduct, सः राजा that king, चिरम् for a long time, तिष्ठते continues to rule.
A king who is alert, omniscient, has control over his senses, has a sense of gratitude and one of righteous conduct continues to rule for a long time.