Hadithcore
Mishkat al-Masabih, 1094

He reported God’s Messenger as saying, "Complete the front row, then the one that comes next, and if there is any incompleteness let it be in the last row.” Abu Dawud transmitted it.

وَعَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «أَتِمُّوا الصَّفَّ الْمُقَدَّمَ ثُمَّ الَّذِي يَلِيهِ فَمَا كَانَ مِنْ نَقْصٍ فَلْيَكُنْ فِي الصَّفّ الْمُؤخر» . رَوَاهُ أَبُو دَاوُد

References1 variant
In-Book Reference
Book 4, Hadith 511