#include <bits/stdc++.h>
using namespace std;
int main() {
  int p, m, a, b, c, d, e, n, maxx = -9999, ans = 0, maxxx = -9999;
  cin >> n;
  char handle[55][20] = {0};
  for (int i = 0; i < n; i++) {
    scanf("\n%s", &handle[i][0]);
    cin >> p >> m >> a >> b >> c >> d >> e;
    maxxx = p * 100 - m * 50 + a + b + c + d + e;
    if (maxxx > maxx) {
      maxx = maxxx;
      ans = i;
    }
  }
  for (int i = 0; handle[ans][i] != 0; i++) printf("%c", handle[ans][i]);
  return 0;
}
