#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> a;
int main(int argc, char *argv[]) {
  cin >> n;
  string maxi;
  int maxv = -210000000;
  for (int i = 0; i < n; ++i) {
    string temp;
    cin >> temp;
    a.push_back(temp);
    int plus, minus, a, b, c, d, e;
    cin >> plus >> minus >> a >> b >> c >> d >> e;
    if (maxv < plus * 100 - minus * 50 + a + b + c + d + e) {
      maxv = plus * 100 - minus * 50 + a + b + c + d + e;
      maxi = temp;
    }
  }
  cout << maxi << endl;
  return 0;
}
