(a) It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that when the Prophet (peace and blessings be upon him) entered the toilet, he would say: 'Allahumma inni a'udhu bika min al-khubuthi wa al-khaba'ith' (O Allah, I seek refuge in You from the male and female devils among the jinn).
(b) Abd al-Aziz reports these words: "When he came to the toilet."
(c) Abd al-Aziz also reports these words: "When he intended to enter the toilet."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 452