#include <stdio.h>
struct student {
char name[20];
float score;
};
int main() {
struct student students[5];
for (int i = 0; i < 5; ++i) {
scanf("%s%f", students[i].name, &students[i].score);
}
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4 - i; ++j) {
if (students[j].score < students[j + 1].score) {
struct student temp = students[j];
students[j] = students[j + 1];
students[j + 1] = temp;
}
}
}
for (int i = 0; i < 5; ++i) {
printf("%s %.1f\n", students[i].name, students[i].score);
}
return 0;
}