Valmiki Ramayana Aranya Kanda Sarga 38 Shloka 26
Original Shlokaअकुर्वन्तोऽपि पापानि शुचयः पापसंश्रयात्। परपापैर्विनश्यन्ति मत्स्या नागह्रदे यथा।।3.38.26।।
1 source checked for this shloka
पापानि sins, अकुर्वन्तोऽपि even without committing, शुचयः pure men, पापसंश्रयात् by contact with sinners, नागह्रदे in a pool of serpents, मत्स्याः यथा like the fish, परपापैः sins committed by others, विनश्यन्ति will be destroyed.
Even without committing any sin those pure souls because they keep company with sinners will be destroyed for the sins of others just like fishes in a pool of serpents.