#include <bits/stdc++.h>
using namespace std;
int n;
string s[100];
int main() {
  scanf("%d", &n);
  int res = -0x3f3f3f3f;
  int p = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    int sum = 0;
    int a, b, c, d, e;
    int su, un;
    scanf("%d%d%d%d%d%d%d", &su, &un, &a, &b, &c, &d, &e);
    sum += 100 * su - un * 50;
    sum += a + b + c + d + e;
    if (sum > res) {
      res = sum;
      p = i;
    }
  }
  cout << s[p] << endl;
  return 0;
}
