#include <bits/stdc++.h>
using namespace std;
struct contestant {
  string name;
  long long points;
};
long long n, i, j, p, m, x;
string s;
vector<contestant> a;
contestant con;
bool myf(contestant a, contestant b) { return (a.points > b.points); }
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long fabs(long long a) {
  if (a >= 0)
    return a;
  else
    return -a;
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> s >> p >> m;
    con.points = p * 100 - m * 50;
    con.name = s;
    for (j = 1; j <= 5; j++) {
      cin >> x;
      con.points += x;
    }
    a.push_back(con);
  }
  sort(a.begin(), a.end(), myf);
  cout << a[0].name << endl;
  return 0;
}
