import tools.*;

class Mejores extends Program {
  void run() {
    // Creación de arreglos
    Array tabNombres= new Array(1000);
    Array tabNotas= new Array(1000);
    // Inicialización de los arreglos y cálculo
    // de la mejor nota
    TextReader lect= new TextReader("notas.txt");
    int i= 0;
    double maxNota= 0.0;
    while (true) {
      String lin= lect.readLine();
      if (lect.eofReached()) // Patrón de lectura de datos
        break;
      String nom= trim(substring(lin, 0, 20));
      double nota= parseDouble(trim(substring(lin, 20, 3)));
      // Patrón de inicialización de arreglos
      tabNombres.put(i, nom);
      tabNotas.put(i, nota);
      if (nota>maxNota)
        maxNota= nota;
      i= i+1; // Patrón de conteo para el nro. de línea
    }
    lect.close();
    // i es el número de líneas leídas
    // Determinar nombres de los que obtuvieron la mejor nota.
    int j=0;
    while (j<i) {
      if (tabNotas.getDouble(j)==maxNota)
        println(tabNombres.getString(j));
      j= j+1;
    }
  }
}
