#include <bits/stdc++.h>
using namespace std;
int A, B, C, D, E, add, mn, ans = -1000000000, n, ind;
char name[100][100];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> name[i] >> add >> mn >> A >> B >> C >> D >> E;
    if (A + B + C + D + E + add * 100 - mn * 50 > ans) {
      ans = A + B + C + D + E + add * 100 - mn * 50;
      ind = i;
    }
  }
  cout << name[ind];
  return 0;
}
