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 also recorded it, Prayer, chapter on straightening and establishing the rows, etc., no. 440, from Qutayba with the same chain. On this subject there are also narrations from Jabir [Ibn Majah no. 1001], Ibn Abbas [see Majma al-Zawaid 2/93], and Ibn Umar, though we did not find it. There are also narrations on this subject from Umar [see Majma al-Zawaid 2/93], Abu Saeed [Ahmad 3/3, 16, and Ibn Khuzayma declared it sahih, no. 1562, and Ibn Hibban, no. 380], Ubayy bin Kaab [Abu Dawud, no. 554], Ayesha [Abdul-Razzaq, no. 247], Irbaz bin Sariya [Ibn Majah no. 996], and Anas [Abu Dawud, no. 671].Hadith, he used to ask forgiveness for the first row three times.