#include <bits/stdc++.h>
using namespace std;
string s, sr, st;
set<char> second;
pair<int, string> pr[100001];
vector<long long> v, vc;
map<string, int> mp;
long long d[1000001];
long long ar[1000001];
long long n, m, r, t, l, b, c, a, cnt, ans, mn = 99999999999;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    cin >> t >> m >> r >> l >> b >> c >> a;
    cnt += t * 100;
    cnt -= m * 50;
    cnt += r + l + b + c + a;
    pr[i] = {cnt, s};
    cnt = 0;
  }
  sort(pr, pr + n);
  reverse(pr, pr + n);
  cout << pr[0].second;
}
