#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, ans;
  int sum, ma = -1005004, mai, a, b, c, d, e, p, m, n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s >> p >> m >> a >> b >> c >> d >> e;
    sum = (p * 100 - m * 50 + a + b + c + d + e);
    if (sum > ma) {
      ma = sum;
      ans = s;
    }
  }
  cout << ans;
}
