The Messenger of Allah ﷺ said, "The best of the men's rows is the first, and the worst of them is the last. The best of the women's rows is the last, and the worst of them is the first."
حدثنا حسن حدثنا حماد بن سلمة عن سهيل بن أبي صالح عن أبيه
قال رسول الله ﷺ خير صفوف الرجال المقدم وشر صفوف الرجال المؤخر وخير صفوف النساء المؤخر وشر صفوف النساء المقدم
Narrated by Muslim, Abu Dawud, Tirmidhi, Nasai, and Ibn Majah on the authority of Abu Hurairah, and by Tabarani in Al-Kabir on the authority of Abu Umama and on the authority of Ibn Abbas, and by Suyuti in Al-Jami Al-Sagheer, who indicated that it is a sahih hadith.