#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-5;
long long getl() {
  long long ret;
  scanf("%I64d", &ret);
  return ret;
}
int score() {
  int ret = 0;
  ret += getl() * 100;
  ret -= getl() * 50;
  for (int i = (0); i < (5); ++i) ret += getl();
  return ret;
}
int main() {
  int n = getl(), maxScore = -50 * 50 - 9999;
  string maxName;
  for (int i = (0); i < (n); ++i) {
    string name;
    cin >> name;
    int sc = score();
    if (sc > maxScore) {
      maxScore = sc;
      maxName = name;
    }
  }
  cout << maxName;
  return 0;
}
