#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int max_points = -(50 * 50 + 1);
  string leader;
  for (int i = 0; i < n; i++) {
    string handle;
    int plus, minus, a, b, c, d, e;
    cin >> handle >> plus >> minus >> a >> b >> c >> d >> e;
    if (plus * 100 - minus * 50 + a + b + c + d + e > max_points)
      max_points = plus * 100 - minus * 50 + a + b + c + d + e, leader = handle;
  }
  cout << leader << '\n';
  return 0;
}
