#include <bits/stdc++.h>
using namespace std;
char t[222];
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, string> > a;
  for (int i = 0; i < n; i++) {
    int t1, t2, sum = 0;
    scanf("%s %d %d", t, &t1, &t2);
    sum = t1 * 100 - t2 * 50;
    for (int j = 0; j < 5; j++) {
      int t3;
      scanf("%d", &t3);
      sum += t3;
    }
    a.push_back(make_pair(sum, t));
  }
  sort(a.rbegin(), a.rend());
  printf("%s", a[0].second.c_str());
  return 0;
}
