#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long double Eps = 1e-8;
template <class T>
inline T sqr(T a) {
  return a * a;
}
int main() {
  int n;
  cin >> n;
  int A[7];
  char name[1000];
  char best[1000] = {0};
  long long mx = -1e9;
  for (int i = (0), ei = (n); i < ei; i++) {
    scanf(" %s", name);
    for (int j = (0), ej = (7); j < ej; j++) scanf("%d", A + j);
    long long sum = A[0] * 100 - A[1] * 50;
    for (int j = (2), ej = (7); j < ej; j++) sum += A[j];
    if (sum > mx) {
      mx = sum;
      strcpy(best, name);
    }
  }
  printf("%s\n", best);
  return 0;
}
