#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, n;
  string s;
  map<string, int> m;
  cin >> n;
  string res;
  while (n--) {
    cin >> s >> a >> b;
    m[s] = a * 100 - b * 50;
    for (int i = 0; i < 5; i++) {
      int k;
      cin >> k;
      m[s] += k;
    }
    map<string, int>::iterator it = m.begin();
    int p = -(int)1e9;
    while (it != m.end()) {
      if (it->second > p) {
        p = it->second;
        res = it->first;
      }
      it++;
    }
  }
  cout << res << endl;
  return 0;
}
