#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int max = -7500;
  string p;
  scanf("%d", &t);
  getchar();
  while (t--) {
    string s;
    int pls, mins, a, b, c, d, e, mex = 0;
    cin >> s;
    cin >> pls >> mins >> a >> b >> c >> d >> e;
    pls = pls * 100;
    mins = mins * 50;
    mex = pls + a + b + c + d + e;
    mex = mex - mins;
    if (mex > max) {
      max = mex;
      p = s;
    }
  }
  cout << p << endl;
  return 0;
}
