#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  while (cin >> n) {
    string name;
    long long suc, uns, u;
    long long mx = -1ll << 42;
    string mx_i = "";
    for (int i = 0; i < n; ++i) {
      cin >> name >> suc >> uns;
      long long point = suc * 100 - 50 * uns;
      for (int i = 0; i < 5; ++i) {
        cin >> u;
        point += u;
      }
      if (mx < point) {
        mx = point;
        mx_i = name;
      }
    }
    cout << mx_i << endl;
  }
  return 0;
}
