Valmiki Ramayana Ayodhya Kanda Sarga 19 Shloka 29
Original Shlokaस रामः पितरं कृत्वा कैकेयीं च प्रदक्षिणम्। निष्क्रम्यान्तःपुरात्तस्मात्स्वं ददर्श सुहृज्जनम्।।2.19.29।।
1 source checked for this shloka
सः रामः that Rama, पितरम् father, कैकेयीं च also, Kaikeyi, प्रदक्षिणं कृत्वा having made circumambulation, तस्मात् from that, अन्तःपुरात् from that harem, निष्क्रम्य after stepping out, स्वम् own, सुहृज्जनम् friends, ददर्श saw.
Hardly had Rama withdrawn from the harem after circumambulating his father and Kaikeyi when he saw his friends .