The Prophet ﷺ said, "Straighten your rows properly in prayer. The best of the men's rows in prayer is the first, and the worst is the last. The best of the women's rows in prayer is the last, and the worst is the first."
حدثنا عبد الرحمن عن زهير يعني ابن محمد الخراساني وأبو عامر قال حدثنا زهير عن العلاء عن أبيه
عن النبي ﷺ قال أحسنوا إقامة الصفوف في الصلاة خير صفوف الرجال في الصلاة أولها وشرها آخرها وخير صفوف النساء في الصلاة آخرها وشرها أولها
Its isnad is sahih. Haythami said in 2/89, "The men of Ahmad's narration are the men of the Sahih." Munziri said likewise in Targheeb 1/320. The hadith previously occurred in 2/385.