#include <bits/stdc++.h>
using namespace std;
long long int arr[2000005];
long long int arr2[2000005];
long long int power[15];
int main() {
  string ans, str;
  long long int n, a, b, c, d, e, p, m, cur, nex;
  cin >> n;
  cin >> ans >> p >> m >> a >> b >> c >> d >> e;
  cur = p * 100 - 50 * m + a + b + c + d + e;
  n--;
  while (n--) {
    cin >> str >> p >> m >> a >> b >> c >> d >> e;
    nex = p * 100 - 50 * m + a + b + c + d + e;
    if (nex > cur) {
      ans = str;
      cur = nex;
    }
  }
  cout << ans << endl;
}
