The Messenger of Allah ﷺ was asked, "Which deeds are most excellent, and which deeds are best?"He answered, "Faith in Allah and His Messenger."The questioner asked, "Then what, Messenger of Allah?"He said, "Jihad in the path of Allah, the pinnacle of all deeds."The questioner asked, "Then what, Messenger of Allah?"He said, "An accepted Hajj."
حدثنا محمد بن بشر حدثنا محمد بن عمرو حدثنا أبو سلمة
سئل رسول الله ﷺ أي الأعمال أفضل وأي الأعمال خير قال إيمان بالله ورسوله قال ثم أي يا رسول الله قال الجهاد في سبيل الله سنام العمل قال ثم أي يا رسول الله قال حج مبرور
Its isnad is sahih. It appears in Jami al-Masanid 7:453-454, taken from this very place, and it has already passed in similar form at 7580 and 7629, narrated by Saeed bin Musayab, from Abu Hurairah. His saying, "which deeds are best" is what is established in the three original manuscripts. In Jami al-Masanid, it has "or" instead of "and".