#include <bits/stdc++.h>
using namespace std;
pair<int, string> pp[60];
int p[100];
string s[100];
int main() {
  int n = ({
    int x;
    scanf("%d", &x);
    x;
  });
  for (int i = 0; i < (n); i++) {
    cin >> pp[i].second;
    int a, b, c, d, e, f, g;
    cin >> a >> b >> c >> d >> e >> f >> g;
    pp[i].first = 100 * a - 50 * b + c + d + e + f + g;
  }
  sort(pp, pp + n);
  cout << pp[n - 1].second << endl;
  return 0;
}
