write candidates to file