#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
int main() {
  ios_base::sync_with_stdio(false);
  string s, t;
  int n, m, p, a, b, c, d, e, x, mx = -INF;
  cin >> n;
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> s >> p >> m >> a >> b >> c >> d >> e;
    x = 100 * p - 50 * m + a + b + c + d + e;
    if (mx < x) {
      t = s;
      mx = x;
    }
  }
  cout << t;
  return 0;
}
