#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, string> > v(n);
  for (int i = 0; i < n; ++i) {
    char s[25];
    int p, m, a, b, c, d, e, sum = 0;
    scanf("%s%d%d%d%d%d%d%d", s, &p, &m, &a, &b, &c, &d, &e);
    sum += p * 100;
    sum -= m * 50;
    sum += a + b + c + d + e;
    v[i] = make_pair(-sum, string(s));
  }
  sort(v.begin(), v.end());
  cout << v[0].second;
  return 0;
}
