#include <bits/stdc++.h>
using namespace std;
string str[50];
int main() {
  int n, i;
  int yes, no, a, b, c, d, e;
  int max;
  int index;
  while (cin >> n) {
    for (i = 0; i < n; i++) {
      cin >> str[i];
      cin >> yes >> no >> a >> b >> c >> d >> e;
      int tt = yes * 100 - no * 50 + a + b + c + d + e;
      if (i == 0) {
        max = tt;
        index = i;
      } else {
        if (max < tt) {
          max = tt;
          index = i;
        }
      }
    }
    cout << str[index] << endl;
  }
}
