#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const int maxlen = 1000;
const int maxn = 100;
template <class T>
bool get_max(T &a, const T &b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
bool get_min(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
char buff[maxlen];
struct Node {
  string name;
  int score;
  void input() {
    scanf("%s", buff);
    name = string(buff);
    score = 0;
    int a, b;
    scanf("%d%d", &a, &b);
    score += a * 100 - b * 50;
    for (int i = 0; i < 5; i++) {
      int val;
      scanf("%d", &val);
      score += val;
    }
  }
  bool operator<(const Node &A) const { return score > A.score; }
} people[maxn];
int main() {
  int N;
  while (scanf("%d", &N) == 1) {
    for (int i = 0; i < N; i++) {
      people[i].input();
    }
    sort(people, people + N);
    printf("%s\n", people[0].name.c_str());
  }
  return 0;
}
