#include <bits/stdc++.h>
using namespace std;
struct per {
  string name;
  int score;
} store[55];
bool cmp(per a, per b) { return a.score > b.score; }
int main() {
  int n, tmp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> store[i].name;
    cin >> tmp;
    store[i].score = 0;
    store[i].score += tmp * 100;
    cin >> tmp;
    store[i].score -= tmp * 50;
    for (int j = 0; j < 5; j++) {
      cin >> tmp;
      store[i].score += tmp;
    }
  }
  sort(store, store + n, cmp);
  cout << store[0].name << endl;
  return 0;
}
