#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int infi = 1e9 + 7;
const long long infl = 1e18;
const long double eps = 1e-7;
const long double eps1 = 1e-10;
const int mod = (1e9 + 7);
const long long mod1 = 1e9 + 7;
const long long mod2 = 1e9 + 9;
const long long p1 = 29;
const long long p2 = 31;
const int ver1 = (62 * 62);
int sum[100500][3];
int s[3];
int s1[3];
void getsum(int l, int r) {
  for (int i = 0; i < 3; ++i) {
    s[i] = sum[r][i];
  }
  if (l) {
    for (int i = 0; i < 3; ++i) {
      s[i] -= sum[l - 1][i];
    }
  }
  return;
}
int main() {
  int n;
  string ans;
  int res = -100000;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string a;
    cin >> a;
    int s = 0;
    int b;
    cin >> b;
    s += b * 100;
    cin >> b;
    s -= b * 50;
    for (int j = 0; j < 5; ++j) {
      cin >> b;
      s += b;
    }
    if (s > res) {
      res = s;
      ans = a;
    }
  }
  cout << ans;
  return 0;
}
