#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1;
  int max = INT_MIN;
  int n;
  cin >> n;
  while (n--) {
    int sc = 0, a;
    cin >> s;
    cin >> a;
    sc += 100 * a;
    cin >> a;
    sc -= 50 * a;
    for (int i = 0; i < 5; i++) {
      cin >> a;
      sc += a;
    }
    if (sc > max) {
      max = sc;
      s1 = s;
    }
  }
  cout << s1;
  return 0;
}
