#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, e, pluss, minuss, n, maxi = -999999999999, sum;
  char handle[30], leader[30];
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) {
    scanf("%s", &handle);
    scanf("%lld", &pluss);
    scanf("%lld", &minuss);
    scanf("%lld", &a);
    scanf("%lld", &b);
    scanf("%lld", &c);
    scanf("%lld", &d);
    scanf("%lld", &e);
    sum = pluss * 100 - minuss * 50 + a + b + c + d + e;
    if (sum > maxi) {
      maxi = sum;
      strcpy(leader, handle);
    }
  }
  printf("%s", leader);
  return 0;
}
