#include <bits/stdc++.h>
using namespace std;
int main() {
  int f, plus, min, a, b, c, d, e, n;
  cin >> n;
  string s, d1;
  int y = -1000000;
  for (int i = 0; i < n; i++) {
    cin >> s;
    cin >> plus >> min >> a >> b >> c >> d >> e;
    f = 100 * plus - 50 * min + a + b + c + d + e;
    if (f > y) {
      d1 = s;
      y = f;
    }
  }
  cout << d1 << endl;
}
