Valmiki Ramayana Yuddha Kanda Sarga 21 Shloka 11
Original Shlokaसत्रिरात्रोषितस्तत्रनयज्ञोधर्मवत्सलः । उपासततदारामस्सागरंसरितांपतिम् ।।6.21.11।।
1 source checked for this shloka
तदा then, तत्र there, नयज्ञः one having political foresight, धर्मवत्सलः lover of dharma, रामः Rama, त्रीरात्रोषितः spent three nights, सरितांपतिम् Lord of rivers, सागरम् the ocean, उपासत waiting upon.
Rama, a lover of dharma, who had political foresight, spent three nights waiting upon the ocean, the Lord of rivers.