pst乙级1082
#include <iostream>
#include <string>
using namespace std;
int main()
{
int n, x, y, ju, max = 0, min = 100000;
string id, id_win, id_lose;
cin >> n;
while (n--)
{
cin >> id >> x >> y;
x = abs(x);
y = abs(y);
ju = x*x + y*y;
if (ju < min)
{
min = ju;
id_win = id;
}
if (ju > max)
{
max = ju;
id_lose = id;
}
}
cout << id_win << " " << id_lose;
return 0;
}