Valmiki Ramayana Sundara Kanda Sarga 9 Shloka 72
Original Shlokaबभूव बुद्धिस्तु हरीश्वरस्य यदीदृशी राघवधर्मपत्नी। इमा यथा राक्षसराजभार्याः सुजातमस्येति हि साधुबुद्धेः।।5.9.72।।
1 source checked for this shloka
इमाः these, राक्षसराजभार्याः wives of the demon lord, यथा as, राघवधर्मपत्नी Rama's lawful wife, ईदृशी such a lady, अस्य his, सुजातम् born of good family, इति thus, साधुबुद्धेः of the wise, हरीश्वरस्य Hanuman's, बुद्धिस्तु thought also, बभूव was.
'If the lawful wife of Rama born of a good family can be allowed to remain with Rama in the same way as the consorts of the lord of demons, how fortunate it would be, thought the wise lord of monkeys'.