Valmiki Ramayana Yuddha Kanda Sarga 17 Shloka 42
Original Shlokaयदिदोषोमहांस्तस्मिंस्त्यज्वतामविशङ्कितम् । गुणान्वापिबहून् ज्ञात्वासङ्ग्रहःक्रियतांनृप ।।6.17.42।।
1 source checked for this shloka
नृप: king, तस्मिन् in him, महान् great, दोषःयदि: if one has bad qualities, अविशङ्कितम् no doubt, त्यज्यताम् to be rejected, बहून् many, गुणान् virtues, ज्ञात्वावापि: knowing them also, सङ्ग्रहः let us take, क्रियताम् we will.
"If there are great bad qualities (in Vibheeshana) no doubt he has to be rejected. If there are many virtues let us take him knowing them also."