#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long max = -1;
  string max_name = "";
  for (int i = 0; i < n; i++) {
    string name;
    int plus, minus, a, b, c, d, e;
    getline(cin, name, ' ');
    cin >> plus >> minus >> a >> b >> c >> d >> e;
    long sum = 0;
    sum += a + b + c + d + e;
    sum += 100 * plus;
    sum -= 50 * minus;
    if (sum > max || i == 0) {
      max = sum;
      max_name = name;
    }
  }
  cout << max_name << endl;
  return 0;
}
