#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e6 + 3;
const int INFI = 1e9 * 2;
const int N = 22;
const int M = 222;
const int move[8][2] = {0, 1, 0, -1, 1, 0, -1, 0, 1, 1, 1, -1, -1, 1, -1, -1};
char ans[N], name[N];
int main() {
  int n, s, m, a, x, y;
  while (scanf("%d", &n) != EOF) {
    m = -INFI;
    for (int i = 0; i < n; i++) {
      scanf("%s", name);
      scanf("%d%d", &x, &y);
      s = x * 100 - y * 50;
      for (int i = 0; i < 5; i++) scanf("%d", &a), s += a;
      if (s > m) {
        m = s;
        strcpy(ans, name);
      }
    }
    printf("%s\n", ans);
  }
  return 0;
}
