The Messenger of Allah ﷺ said, "The best of the men's rows is the first and the worst is the last, and the best of the women's rows is the last and the worst is the first."
حدثنا محمد بن الصباح البزاز حدثنا خالد وإسمعيل بن زكرياء عن سهيل بن أبي صالح عن أبيه
قال رسول الله ﷺ خير صفوف الرجال أولها وشرها آخرها وخير صفوف النساء آخرها وشرها أولها
Muslim narrated it, Prayer, chapter on straightening the rows and establishing them and the merit of the first rows and so on, hadith no. 440, from the hadith of Suhayl bin Abu Salih, with this wording.