#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  pair<int, string> arr[50];
  int i, a;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    cin >> arr[i].second;
    arr[i].first = 0;
    cin >> a;
    arr[i].first -= a * 100;
    cin >> a;
    arr[i].first += a * 50;
    cin >> a;
    arr[i].first -= a;
    cin >> a;
    arr[i].first -= a;
    cin >> a;
    arr[i].first -= a;
    cin >> a;
    arr[i].first -= a;
    cin >> a;
    arr[i].first -= a;
  }
  sort(arr, arr + N);
  cout << arr[0].second << endl;
  return 0;
}
