#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum[1000], p, m, a, b, c, d, e, n, max = -10000, i, k;
  char v[100][100];
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%s %d %d %d %d %d %d %d", v[i], &p, &m, &a, &b, &c, &d, &e);
    sum[i] = p * 100 - 50 * m + a + b + c + d + e;
  }
  for (i = 1; i <= n; i++) {
    if (sum[i] > max) {
      max = sum[i];
      k = i;
    }
  }
  printf("%s\n", v[k]);
  return 0;
}
