#include <bits/stdc++.h>
int main() {
  int i, j, n, a, b, pre, point, ans, Max = -3000;
  char name[51][21];
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%s%d%d", name[i], &a, &b);
    ans = a * 100 - b * 50;
    for (j = 1; j <= 5; j++) {
      scanf("%d", &point);
      ans += point;
    }
    if (ans > Max) {
      pre = i;
      Max = ans;
    }
  }
  printf("%s\n", name[pre]);
  return 0;
}
