It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The best rows of the men are the first and the worst are the last, and the best rows of the women are the last and the worst are the first."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5129