The Prophet ﷺ was asked, "Which deeds are best?"He replied, "Faith in Allah and His Messenger."He was asked, "Then what?"He said, "Then jihad in the path of Allah."He was asked, "Then what?"He said, "Then an accepted pilgrimage."
حدثنا أبو كامل حدثنا إبراهيم حدثنا ابن شهاب عن سعيد بن المسيب
سئل النبي ﷺ أي الأعمال أفضل قال إيمان بالله ورسوله قال ثم ماذا قال ثم الجهاد في سبيل الله قيل ثم ماذا قال ثم حج مبرور
Its isnad is sahih. Bukhari 1:73 and Muslim 1:31 both narrated it, by way of Ibrahim bin Saad, with this isnad. Munziri mentioned it in Targheeb wa Tarheeb 2:105 and 172, attributing it in the first place to the two Shaykhs, and in the second place to them along with Tirmidhi and Nasai. See 7502, where we have already pointed to this.