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