#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> contestant;
  int people;
  scanf("%d", &people);
  while (people > 0 && people--) {
    string name;
    int total = 0, success, unsuccess, pa, pb, pc, pd, pe;
    cin >> name;
    scanf("%d%d%d%d%d%d%d", &success, &unsuccess, &pa, &pb, &pc, &pd, &pe);
    total += (pa + pb + pc + pd + pe + 100 * success - 50 * unsuccess);
    contestant[name] = total;
  }
  int max = -999999;
  string nama;
  for (map<string, int>::iterator i = contestant.begin(); i != contestant.end();
       i++) {
    if ((*i).second > max) {
      nama = (*i).first;
      max = (*i).second;
    }
  }
  cout << nama << endl;
  return 0;
}
