"The Prophet (ﷺ) would put his head out for me while he was performing I'tikaf and I would wash it, when I was menstruating." Mujawir ("next door") here means while performing I'tikaf.
Sunan an-Nasa'i Book 1, Hadith 277