#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m = INT_MIN, score;
  string leader;
  cin >> n;
  while (n--) {
    string s;
    int a[7];
    score = 0;
    cin >> s;
    for (int i = 0; i < 7; i++) {
      cin >> a[i];
      if (i == 0)
        score += (a[0] * 100);
      else if (i == 1)
        score -= (a[1] * 50);
      else
        score += a[i];
    }
    if (score > m) m = score, leader = s;
  }
  cout << leader << endl;
}
