#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int a, b, c, d, e, f, g;
  cin >> N;
  vector<pair<int, string> > t(N);
  for (int i = 0; i < N; i++) {
    cin >> t[i].second >> a >> b >> c >> d >> e >> f >> g;
    t[i].first = a * 100 - b * 50 + c + d + e + f + g;
  }
  std::sort(t.begin(), t.end(), greater<pair<int, string> >());
  cout << t[0].second << endl;
  return 0;
}
