Abu Hurairah (May Allah be pleased with him) reported:
I heard Messenger of Allah (ﷺ) saying, "People are like gold and silver; those who were best in Jahiliyyah (Pre-Islamic Period of Ignorance) are best in Islam, if they have religious understanding; and the souls are like recruited soldiers, they get mixed up with those similar with them in qualities and oppose and drift away from those who do not share their qualities".[Muslim].
Arabic/English book reference: Book 1, Hadith 371