#include <bits/stdc++.h>
using namespace std;
struct user {
  char nick[30];
  int plus;
  int minus;
  int a;
  int b;
  int c;
  int d;
  int e;
  int total;
};
bool str(user a, user b) {
  if (a.total > b.total) {
    return 1;
  }
  return 0;
}
int main() {
  int n;
  int i;
  cin >> n;
  user u[51];
  for (i = 0; i < n; i++) {
    cin >> u[i].nick;
    cin >> u[i].plus;
    cin >> u[i].minus;
    cin >> u[i].a;
    cin >> u[i].b;
    cin >> u[i].c;
    cin >> u[i].d;
    cin >> u[i].e;
    u[i].total = u[i].a + u[i].b + u[i].c + u[i].d + u[i].e +
                 (u[i].plus * 100) - (u[i].minus * 50);
  }
  sort(u, u + n, str);
  cout << u[0].nick << endl;
  return 0;
}
