From Sahih Muslim (Hadith 6533):
This hadith has been transmitted on the authority of Zuhri with a slight variation of wording (and the words are):" The one turning away and the other turning away when they meet and one avoids the other and the other also avoids him
Reference: Muslim 6533