Sefer Chasidim Siman 525
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
יותר טוב למי שהוא בן רשעים ואינו הולך בדרכיהם ממי שהוא בן צדיקים והולך וחוטא וכן יותר רע הוא מי שדר בין צדיקים וחוטא ממי שדר בין רשעים וחוטא והוי זהיר במצוה הבאה לפרקים ועוברת: