عَنْ أَبِي هُرَيْرَةَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «أَيُّمَا رَجُلٍ أَفْلَسَ فَأَدْرَكَ رَجُلٌ مَالَهُ بِعَيْنِهِ فَهُوَ أَحَق بِهِ من غَيره»
Translation
Abu Rafi‘said

God’s Messenger borrowed a young camel, and when the camels of the sadaqa came to him he ordered me to pay the man his young camel. When I told him that I could find only an excellent camel in its seventh year he said, “Give it to him, for the best person is he who discharges his debt in the best manner." Muslim transmitted it.