#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, plus, minus, a, b, c, d, e, maxp = -1000000000, p;
  string s, res;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s >> plus >> minus >> a >> b >> c >> d >> e;
    p = plus * 100 - minus * 50 + a + b + c + d + e;
    if (p > maxp) maxp = p, res = s;
  }
  cout << res << endl;
  return 0;
}
