SP wins Mainpuri