#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int max_point = -1000000;
  string ans;
  string temp_name;
  int temp_crack_s;
  int temp_crack_un;
  int temp_a;
  int temp_b;
  int temp_c;
  int temp_d;
  int temp_e;
  int temp;
  for (int i = 0; i < n; i++) {
    cin >> temp_name >> temp_crack_s >> temp_crack_un >> temp_a >> temp_b >>
        temp_c >> temp_d >> temp_e;
    temp = temp_crack_s * 100 - temp_crack_un * 50 + temp_a + temp_b + temp_c +
           temp_d + temp_e;
    if (temp > max_point) max_point = temp, ans = temp_name;
  }
  cout << ans;
}
