#include <bits/stdc++.h>
using namespace std;
typedef struct {
  string handle;
  int sushack;
  int fadehack;
  int Apoint;
  int Bpoint;
  int Cpoint;
  int Dpoint;
  int Epoint;
  int Point;
} contestants;
int main() {
  contestants par[50];
  int n;
  int max;
  int sign;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> par[i].handle;
    cin >> par[i].sushack;
    cin >> par[i].fadehack;
    cin >> par[i].Apoint;
    cin >> par[i].Bpoint;
    cin >> par[i].Cpoint;
    cin >> par[i].Dpoint;
    cin >> par[i].Epoint;
    par[i].Point = par[i].sushack * 100 - par[i].fadehack * 50 + par[i].Apoint +
                   par[i].Bpoint + par[i].Cpoint + par[i].Dpoint +
                   par[i].Epoint;
  }
  max = par[0].Point;
  sign = 0;
  for (int i = 1; i < n; i++) {
    if (par[i].Point > max) {
      sign = i;
      max = par[i].Point;
    }
  }
  cout << par[sign].handle;
  cout << endl;
  return 0;
}
