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