#include <bits/stdc++.h>
int main() {
  char name[100], winner[100];
  int sh, uh, a, b, v, c, d, e;
  int n, i;
  int sum;
  int total = sum;
  scanf("%d", &n);
  scanf("%s %d %d %d %d %d %d %d", name, &sh, &uh, &a, &b, &c, &d, &e);
  sum = sh * 100 - uh * 50 + a + b + c + d + e;
  total = sum;
  strcpy(winner, name);
  for (i = 0; i < n - 1; i++) {
    scanf("%s %d %d %d %d %d %d %d", name, &sh, &uh, &a, &b, &c, &d, &e);
    sum = sh * 100 - uh * 50 + a + b + c + d + e;
    if (sum > total) {
      total = sum;
      strcpy(winner, name);
    }
  }
  printf("%s", winner);
  return 0;
}
