#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[50][7], b[50] = {0}, d = 0;
  string x[50];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    for (int j = 0; j < 7; j++) cin >> a[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      if (j == 0)
        a[i][j] *= 100;
      else
        a[i][j] *= -50;
    }
    for (int j = 0; j < 7; j++) b[i] += a[i][j];
  }
  int max = b[0];
  for (int i = 1; i < n; i++) {
    if (b[i] > max) {
      max = b[i];
      d = i;
    }
  }
  cout << x[d];
  return 0;
}
