Sahih Muslim, Book 51, Hadith 21 (Muslim 6961)

Ibn Umar reported Allah's Apostle (ﷺ) saying like this but with this change of words:

" She sometimes finds a way in one flock and then in another flock."