#include <bits/stdc++.h>
using namespace std;
const int N = 50;
const int C = 21;
const int V = 7;
struct score {
  int ptr;
  int value;
  score() { value = 0; }
};
int cmp(score* x, score* y) { return y->value - x->value; }
int main() {
  int n;
  cin >> n;
  int values[V];
  score scr[N];
  char contestant[N][C];
  for (int i = 0; i < n; i++) {
    cin >> contestant[i];
    for (int j = 0; j < V; j++) cin >> values[j];
    scr[i].ptr = i;
    scr[i].value += values[0] * 100;
    scr[i].value -= values[1] * 50;
    for (int j = 2; j < V; j++) scr[i].value += values[j];
  }
  qsort(scr, n, sizeof(scr[0]), (int (*)(const void*, const void*))cmp);
  cout << contestant[scr[0].ptr];
  return 0;
}
