#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans, a, b = -10000000000;
  string name, h;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> name;
    ans = 0;
    for (int j = 0; j < 7; j++) {
      cin >> a;
      if (j == 0)
        ans += a * 100;
      else if (j == 1)
        ans -= a * 50;
      else
        ans += a;
    }
    if (ans > b) {
      b = ans;
      h = name;
    }
  }
  cout << h << endl;
  return 0;
}
