#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[100];
  int n, i, x, max = -999999;
  cin >> n;
  for (i = 1; i <= n; i++) {
    int p, m, a, b, c, d, e;
    cin >> s[i] >> p >> m >> a >> b >> c >> d >> e;
    if (max < (100 * p) - (50 * m) + a + b + c + d + e) {
      x = i;
      max = (100 * p) + a + b + c + d + e - (50 * m);
    }
  }
  cout << s[x];
  return 0;
}
