#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long Max;
  string Maxh;
  for (int i = 0; i < n; i++) {
    string h;
    cin >> h;
    long long a, b, c, d, e, sum = 0;
    cin >> a;
    sum += a * 100;
    cin >> a;
    sum -= a * 50;
    cin >> a;
    sum += a;
    cin >> b;
    sum += b;
    cin >> c;
    sum += c;
    cin >> d;
    sum += d;
    cin >> e;
    sum += e;
    if (sum > Max || i == 0) {
      Maxh = h;
      Max = sum;
    }
  }
  cout << Maxh << endl;
}
