Sunan an-Nasa'i, Book 21, Hadith 200 (Nasa'i 2022)

It was narrated from Hisham bin 'Amir that the Messenger of Allah said:

"Dig graves and dig them well, and bury two or three (together), and put in first the one who knew the Qur'an most."