#include <bits/stdc++.h>
using namespace std;
int main() {
  string name;
  int a = -(int)10e9, n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string tname;
    int m, p, A, B, C, D, E;
    cin >> tname >> p >> m >> A >> B >> C >> D >> E;
    int ball = p * 100 - m * 50 + A + B + C + D + E;
    if (ball > a) {
      name = tname;
      a = ball;
    }
  }
  cout << name;
  return 0;
}
