#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, plus, minus, a, b, c, d, e, maxscore = 0, score;
  cin >> n;
  string ms, s;
  cin >> s >> plus >> minus >> a >> b >> c >> d >> e;
  score = plus * 100 - minus * 50 + a + b + c + d + e;
  maxscore = score;
  ms = s;
  while (--n) {
    cin >> s >> plus >> minus >> a >> b >> c >> d >> e;
    score = plus * 100 - minus * 50 + a + b + c + d + e;
    if (score > maxscore) {
      maxscore = score;
      ms = s;
    }
  }
  cout << ms;
}
