#include <iostream>
#include <vector>
using namespace std;
int main()
{
int num;
cin>>num;
vector<string> names;
vector<string> numbers;
vector<int> scores;
for(int i=0;i<num;i++)
{
string name,number;
int score;
cin>>name;
cin>>number;
cin>>score;
names.push_back(name);
numbers.push_back(number);
scores.push_back(score);
}
int max_score=scores[0];
for(int i=1;i<scores.size();i++)
{
if(scores[i]>max_score)
max_score=scores[i];
}
int index;
for(int i=0;i<scores.size();i++)
{
if(max_score==scores[i])
{
index=i;
break;
}
}
cout<<names[index]<<' '<<numbers[index]<<endl;
int min_score=scores[0];
for(int i=1;i<scores.size();i++)
{
if(scores[i]<min_score)
min_score=scores[i];
}
for(int i=0;i<scores.size();i++)
{
if(min_score==scores[i])
{
index=i;
break;
}
}
cout<<names[index]<<' '<<numbers[index]<<endl;
return 0;
}
网友评论