The two candidates receiving the highest number of votes for mayor shall be the candidates, and the only candidates whose names shall be placed upon the ballot for mayor at the next succeeding general municipal election, and in cities having a population of eight thousand and less than thirty thousand the eight candidates having the highest number of votes for councilmen, or all such candidates if less than eight, and in cities having a population of three thousand and less than eight thousand the four candidates receiving the highest number of votes for councilmen, or all such candidates if less than four, shall be the candidates and the only candidates whose names shall be placed upon the ballot for councilman at such municipal election.