#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, maxi = 0;
  scanf("%d", &n);
  string res;
  for (int i = 0; i < n; ++i) {
    string name;
    int x, y, a, b, c, d, e;
    cin >> name >> x >> y >> a >> b >> c >> d >> e;
    int sum = x * 100 - y * 50 + a + b + c + d + e;
    if (i == 0 || sum > maxi) {
      maxi = sum;
      res = name;
    }
  }
  cout << res << endl;
  return 0;
}
