#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<int, string> > V;
  int i, N, X, A, B, C, D, E, P, M;
  string Name;
  cin >> N;
  for (i = 0; i < N; ++i) {
    cin >> Name >> P >> M >> A >> B >> C >> D >> E;
    X = A + B + C + D + E + 100 * P - 50 * M;
    V.push_back(pair<int, string>(X, Name));
  }
  sort(V.begin(), V.end());
  cout << V[N - 1].second;
  return 0;
}
