#include <bits/stdc++.h>
using namespace std;
set<pair<int, string> > s;
int main() {
  string name;
  int n;
  scanf("%d", &n);
  int score = 0;
  for (size_t i = 0; i < n; ++i) {
    name = "";
    score = 0;
    int x;
    cin >> name;
    scanf("%d", &x);
    score += x * 100;
    scanf("%d", &x);
    score -= x * 50;
    scanf("%d", &x);
    score += x;
    scanf("%d", &x);
    score += x;
    scanf("%d", &x);
    score += x;
    scanf("%d", &x);
    score += x;
    scanf("%d", &x);
    score += x;
    s.insert(make_pair(-score, name));
  }
  printf("%s", s.begin()->second.c_str());
  return 0;
}
