import java.io.*;
import java.text.*;
import java.util.*;
 
class Student
{
  String name;
  int id;
  float gpa;
} // Student

public class StudentList
{
  static void outputStudents(Student[] student, int nStudents)
  {
    String b = "                              ";
    int i;
    for (i = 0; i < nStudents; i++)
    {
      System.out.print("Name = " + student[i].name);
      System.out.print(b.substring(student[i].name.length()));
      System.out.print(" ID = "
        + new DecimalFormat("0000000").format(student[i].id));
      System.out.println(" gpa = " + student[i].gpa);
    } // for
  } // outputStudents

  public static void main(String[] argv) throws Exception
  {
    // open a file for input
    BufferedReader fin;
    fin = new BufferedReader(new FileReader("students.txt"));
 
    // create an empty list of capacity 100
    int nStudents = 0;
    Student[] student = new Student[100];
 
    // read and save the records
    while (fin.ready())
    {
      // create a record and read it from file
      Student aStudent = new Student();
      aStudent.name = fin.readLine();
      aStudent.id = new Double(fin.readLine()).intValue();
      aStudent.gpa = new Double(fin.readLine()).floatValue();

      fin.readLine(); // skip the ---------- separator

      // add record to list, if it's not full
      if (nStudents < student.length)
        student[nStudents++] = aStudent;
    } // while
    fin.close();
 
    // sort the students by name
    for (int i = 0; i < nStudents; i++)
    {
      for (int j = i + 1; j < nStudents; j++)
      {
        if (student[i].name.compareTo(student[j].name) > 0)
        {
          Student temp = student[i];
          student[i] = student[j];
          student[j] = temp;
        }
      }
    }

    outputStudents(student, nStudents);
  } // main
} // public class
