Hadithcore
Sahih Muslim, 2168 c
sahih

Sayyar reported:

I was walking with Thibit al-Bunani that he happened to pass by children and he greeted them. And Thibit reported that he walked with Anas and he happened to pass by children and he greeted them. and Anas reported that he walked with Allah's Messenger (may peace be upon. him) and he happened, to pass by children and he greeted them.

وَحَدَّثَنِي عَمْرُو بْنُ عَلِيٍّ، وَمُحَمَّدُ بْنُ الْوَلِيدِ، قَالاَ حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، عَنْ سَيَّارٍ، قَالَ كُنْتُ أَمْشِي مَعَ ثَابِتٍ الْبُنَانِيِّ فَمَرَّ بِصِبْيَانٍ فَسَلَّمَ عَلَيْهِمْ ‏.‏ وَحَدَّثَ ثَابِتٌ أَنَّهُ كَانَ يَمْشِي مَعَ أَنَسٍ فَمَرَّ بِصِبْيَانٍ فَسَلَّمَ عَلَيْهِمْ ‏.‏ وَحَدَّثَ أَنَسٌ أَنَّهُ كَانَ يَمْشِي مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم فَمَرَّ بِصِبْيَانٍ فَسَلَّمَ عَلَيْهِمْ ‏.‏

References2 variants
In-Book Reference
Book 39, Hadith 20
USC-MSA web (English) reference
Book 26, Hadith 5392 (deprecated numbering scheme)