#include <bits/stdc++.h>
using namespace std;
struct My {
  int number, count;
};
bool forSort(My m1, My m2) { return m1.count > m2.count; }
const int MAX = 55;
int n;
My a[MAX];
string names[MAX];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> names[i];
    int t;
    a[i].count = 0;
    cin >> t;
    a[i].count += t * 100;
    cin >> t;
    a[i].count -= t * 50;
    int t1, t2, t3, t4, t5;
    cin >> t1 >> t2 >> t3 >> t4 >> t5;
    a[i].count += t1 + t2 + t3 + t4 + t5;
    a[i].number = i;
  }
  sort(a, a + n, forSort);
  cout << names[a[0].number];
  return 0;
}
