#include <bits/stdc++.h>
using namespace ::std;
string A[60];
int v[60], t, r = INT_MIN, ir, p, m, a, b, c, d, e;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> t;
  for (int i = 0; i < t; ++i) {
    cin >> A[i] >> p >> m >> a >> b >> c >> d >> e;
    int test = 100 * p - 50 * m + a + b + c + d + e;
    if (r < test) r = test, ir = i;
  }
  cout << A[ir] << endl;
  return 0;
}
