import tools.*;
import io.*;

class Votos extends Program {
  void run() {
    TextReader lect= new TextReader("votos.txt");

    Array tab= new Array(8); // Crea un arreglo asociativo

    // Crear las filas del arreglo asociativo
    // El valor inicial asociado a cada candidato es 0
    int cand= 0;
    while (cand<8) {
      tab.put(cand, 0); // Asocia 0 al candidato cand
      cand= cand+1;
    }

    // Leer los votos
    while(true) {
      int candVoto= lect.readInt();
      if (lect.eofReached())
        break;
      int anterior= tab.getInt(candVoto);  // Obtiene el valor asociado
      int nuevo= anterior+1;
      tab.put(candVoto, nuevo); // Cambiar el valor asociado
    }

    cand= 0;
    while (cand<8) {
      println("Candidato "+cand+": "+tab.getInt(cand));
      cand= cand+1;
    }

    lect.close();
  }
}
