#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x, max, q;
  struct player {
    char name[121];
    long score;
  } p[51];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> p[i].name;
    cin >> x;
    p[i].score = 100 * x;
    cin >> x;
    p[i].score -= 50 * x;
    cin >> x;
    p[i].score += x;
    cin >> x;
    p[i].score += x;
    cin >> x;
    p[i].score += x;
    cin >> x;
    p[i].score += x;
    cin >> x;
    p[i].score += x;
  }
  q = 0;
  max = p[0].score;
  for (i = 1; i < n; i++)
    if (p[i].score >= max) {
      max = p[i].score;
      q = i;
    }
  cout << p[q].name << '\n';
  return 0;
}
