Problem A
Grades
Languages
da
en
The grading scheme of the European Credit Transfer and Accumulation System (ECTS) uses 7 grades given as letters: A, B, C, D, E, FX, and F in that order, with A being the highest grade.
Lektor Blomme needs your help in sorting his students by grade. Students with a higher grade should appear before students with a lower grade.
In some courses, lektor Blomme was dissatisfied with the coarseness of the ECTS grading scheme. In those courses he used + and - modifiers to get more fine-grained grades as such as “A+” or “B-” with the obvious interpretation. For intance, grade C+++ is better than C++, and B+ is better than B, and B is better than B-.
Test groups
There are 4 different test groups, each worth 25 points.
Test group |
Points |
Allowed grades |
1 |
25 |
A, B, C, D, E, F |
2 |
25 |
A, B, C, D, E, FX, F |
3 |
25 |
A, B, C, D, E, FX, F, followed by at most one
|
4 |
25 |
No further restrictions |
Input
The input starts with the the number
Output
The students, one per line, ordered by grade, best students first. Students with the same grade must be ordered alphabetically.
Sample Input 1 | Sample Output 1 |
---|---|
10 abelone A andersine A bo A bosse A anton F antonina F anders A konstantin F william F andreas A |
abelone anders andersine andreas bo bosse anton antonina konstantin william |
Sample Input 2 | Sample Output 2 |
---|---|
10 abelone A-------- andersine A+ bo A bosse A++ anton FX- antonina FX+ anders A+ konstantin FX william F andreas A+ |
bosse anders andersine andreas bo abelone antonina konstantin anton william |