#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
int n;
int x, y;
pair<int, string> a[1 << 10];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    a[i].first = 0;
    cin >> a[i].second;
    cin >> x >> y;
    a[i].first -= x * 100;
    a[i].first += y * 50;
    for (int j = 0; j < 5; ++j) {
      cin >> x;
      a[i].first -= x;
    }
  }
  sort(a, a + n);
  cout << a[0].second << endl;
  return 0;
}
