import java.util.StringTokenizer;
import java.io.*;

public class StudentFile {

   public static void main(String[] args) {

   BufferedReader fis = null;
   PrintWriter    fos = null;

   String[] name = new String[100];

   int[] mark1 = new int[100];
   int[] mark2 = new int[100];
   int[] total = new int[100];

   StringTokenizer fields;

   int count = 0;

   try {
       fis =
            new BufferedReader(new FileReader("Student.Dat"));
       fos =
            new PrintWriter(new FileWriter("Result.dat"));

       String line = fis.readLine();

       while ( line != null) {
            count++;
            fields = new StringTokenizer(line);
            name[count] = fields.nextToken();
            mark1[count] = Integer.parseInt(fields.nextToken());
            mark2[count] = Integer.parseInt(fields.nextToken());
            total[count] = mark1[count] + mark2[count];
            line = fis.readLine();
       }
   }

     catch (FileNotFoundException e) {
       System.out.println("File Student.Dat not found.");
     }
     catch (IOException e2) {
       System.out.println(e2.toString());
     }

     finally {
       try
       {
         fis.close();
         fos.close();
       }
       catch (IOException ex)
       {
          System.out.println(ex);
       }
     }
     findHighest(name, total, count);
 }

 public static void findHighest(String[] name, int[] finalMark, int count) {
     int max = 0, index = 0;
     for (int i=1; i<= count; i++)
         if (finalMark[i] > max) {
            max = finalMark[i];
            index = i;
         }

     System.out.println(name[index]+" has the higest mark of " +
          finalMark[index]);
 }
}


     
