The Messenger of Allah ﷺ said, "The best of the men's rows is the first, and the worst is the last. The best of the women's rows is the last, and the worst is the first."
قال رسول الله ﷺ: خير صفوف الرجال أولها، وشرها آخرها، وخير صفوف النساء آخرها، وشرها أولها.
Muslim narrated it in the Book of Prayer (440) from the hadith of Suhayl bin Abu Salih, from his father, from Abu Hurairah, and he mentioned the hadith. Imam Ahmad narrated it (10290) through Ala bin Abdul-Rahman, from his father, from Abu Hurairah, and he added at the beginning of the hadith, "Straighten the rows properly in prayer." Ibn Majah (1000) combined the two chains, but he was content to mention the wording of the hadith just as Suhayl narrated it. Ibn Khuzayma (1561) and others narrated it through Ala bin Abdul-Rahman, and he mentioned it the same as Suhayl's hadith. From this it becomes clear that Abu Hurairah sometimes narrated it with both wordings, and at other times with a single wording.