#include <stdio.h> int main() { struct{ char name[11]; char id[11]; int score; } a[100]; int n, p, q; int max = 0,min = 100; scanf("%d", &n); for (int i = 0; i < n; ++i){ scanf("%s%s%d", &a[i].name, &a[i].id, &a[i].score); if (a[i].score > max) { max = a[i].score; p = i; } if (a[i].score < min) { min = a[i].score; q = i; } } printf("%s %s\n", a[p].name, a[p].id); printf("%s %s\n", a[q].name, a[q].id); return 0; }