#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> data;
  int n, i;
  cin >> n;
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    int p, m, a, b, c, d, e;
    cin >> p >> m >> a >> b >> c >> d >> e;
    data[s] = p * 100 - m * 50 + a + b + c + d + e;
  }
  map<string, int>::iterator it;
  it = data.begin();
  string ans;
  n = -1000000000;
  while (it != data.end()) {
    if (it->second > n) {
      n = it->second;
      ans = it->first;
    }
    it++;
  }
  cout << ans << endl;
  return 0;
}
