#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string ans;
  int maxScore = -99999999;
  for (int i = 0; i < n; i++) {
    string name;
    int pp, mm;
    cin >> name;
    cin >> pp >> mm;
    int score = pp * 100 - mm * 50;
    for (int j = 0; j < 5; j++) {
      int t;
      cin >> t;
      score += t;
    }
    if (score > maxScore) {
      maxScore = score;
      ans = name;
    }
  }
  cout << ans << endl;
  return 0;
}
