#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
void solve() {
  int n;
  cin >> n;
  string name;
  int plus, minus, a;
  long long mx = -100000000;
  string mxname = "";
  for (int i = 0; i < n; i++) {
    cin >> name >> plus >> minus;
    long long sum = plus * 100 - 50 * minus;
    for (int j = 0; j < 5; j++) {
      cin >> a;
      sum += a;
    }
    if (sum > mx) {
      mx = sum;
      mxname = name;
    }
  }
  cout << mxname;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
