#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int maxix = -900000;
  string ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string nam;
    int suc, unsuc, a, b, c, d, e;
    cin >> nam >> suc >> unsuc >> a >> b >> c >> d >> e;
    int jam = suc * 100 - unsuc * 50 + a + b + c + d + e;
    if (jam > maxix) ans = nam, maxix = jam;
  }
  cout << ans;
  return 0;
}
