#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, b, c, d, e, h, nh;
  string name;
  pair<int, string> aa[n];
  for (int i = 0; i < n; i++) {
    cin >> name >> h >> nh >> a >> b >> c >> d >> e;
    aa[i].second = name;
    aa[i].first = 0;
    aa[i].first += h * 100;
    aa[i].first -= nh * 50;
    aa[i].first += (a + b + c + d + e);
  }
  sort(aa, aa + n);
  cout << aa[n - 1].second;
  return 0;
}
