#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
string *result = new string[100];
int cc = 0;
do {
cin >> N;
int L,W,H;
int t_max=-1;
int t_min=-1;
string M,maxname,minname;
for (int i = 0; i < N; i++) {
cin >> L >> W >> H >> M;
int temp = L*W*H;
if(t_min == -1) {
t_min = temp;
minname = M;
}
if(temp>t_max) {
t_max = temp;
maxname = M;
}
if(temp<t_min) {
t_min = temp;
minname = M;
}
}
if(N!=-1) {
result[cc] = maxname+string(" took clay from ")+minname+string(".");
cc++;
}
}while(N!=-1);
for(int i=0;i<100;i++) {
cout<<result[i]<<endl;
}
delete[] result;
return 0;
}
网友评论