Valmiki Ramayana Ayodhya Kanda Sarga 52 Shloka 78
Original Shlokaराघवोऽपि महातेजा नावमारुह्य तां ततः। ब्रह्मवत् क्षत्रवच्चैव जजाप हितमात्मनः।।2.52.78।।
1 source checked for this shloka
महातेजाः राघवोऽपि even resplendent Rama, तां नावम् that boat, आरुह्य having boarded, ततः then, ब्रह्मवत् befitting brahmins, क्षत्रवच्चैव and also befitting kshatriyas, आत्मनः his own, हितम् welfare, जजाप muttered mantras.
Resplendent Rama boarded the boat and muttered for his own safety mantras befitting brahmins and kshatriyas.