In an election of sarpanch, there were two candidates. A total of 9791 votes were cast, out of which the successful candidate got 116 votes more than the other candidate. If the successful candidate got 5 votes in place of 4, how many votes did each candidate receive?