#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n1, n2, a, b, c, d, e, sum1 = -1000000, sum2 = -100000;
  string s;
  string name;
  cin >> t;
  while (t--) {
    cin >> s >> n1 >> n2 >> a >> b >> c >> d >> e;
    sum1 = (n1 * 100) - (n2 * 50) + a + b + c + d + e;
    if (sum1 > sum2) {
      name = s;
    }
    sum2 = max(sum2, sum1);
  }
  cout << name;
}
