#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
int exp[5001],dis[5001];
char nam[5001][30];
int absint(int a)
{
if (a>=0)
return(a);
else
return(-a);
}
int main(void)
{
freopen("savez.in","r",stdin);
freopen("savez.out","w",stdout);
long long mincost=0,cost;
int i,j,n,minpos;
n=0;
while (scanf("%d %d %s",&exp[n],&dis[n],&nam[n])==3)
n++;
minpos=1;
for (j=0;j<n;j++)
mincost+=absint(dis[0]-dis[j])*exp[j];
for (i=1;i<n;i++)
{
cost=0;
for (j=0;j<n;j++)
cost+=absint(dis[i]-dis[j])*exp[j];
if (cost<mincost)
{
mincost=cost;
minpos=i;
}
}
printf("%s\n",nam[minpos]);
fclose(stdin);
fclose(stdout);
return(0);
}