#include <bits/stdc++.h>
using namespace std;
template <typename L>
inline void Read(L &X) {
  char c = getchar();
  L zhi = 0, fu = 1;
  while (!isdigit(c)) {
    if (c == '-') fu = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    zhi = (zhi << 1) + (zhi << 3) + c - '0';
    c = getchar();
  }
  X = fu * zhi;
}
template <typename L>
inline void Write(L X) {
  if (X < 0) putchar('-'), X = -X;
  if (X > 9) Write(X / 10);
  putchar(X % 10 ^ 48);
}
struct node {
  int a, b, c, d, e, p, m, s;
  char h[1001];
} x[1001];
bool cmp(node A, node B) { return A.s < B.s; }
int main() {
  int n;
  Read(n);
  for (register int i = 1; i <= n; ++i) {
    cin >> x[i].h;
    Read(x[i].p);
    Read(x[i].m);
    Read(x[i].a);
    Read(x[i].b);
    Read(x[i].c);
    Read(x[i].d);
    Read(x[i].e);
    x[i].s =
        x[i].a + x[i].b + x[i].c + x[i].d + x[i].e + x[i].p * 100 - x[i].m * 50;
  }
  sort(x + 1, x + n + 1, cmp);
  cout << x[n].h;
  return 0;
}
