#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, plus, minus, a, b, c, d, e, total, max = -1000000000;
  string name, leader;
  cin >> n;
  while (n--) {
    total = 0;
    cin >> name;
    cin >> plus >> minus >> a >> b >> c >> d >> e;
    total = a + b + c + d + e + plus * 100 - minus * 50;
    if (total > max) {
      max = total;
      leader = name;
    }
  }
  cout << leader << endl;
  return 0;
}
