시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB17471294121275.608%

문제

Little hobbitses go to hobbit school in the Shire. They just finished a course, which involved tea-making, meal-eating, nap-taking, and gardening. Based on the following grading scale, assign each hobbit a letter grade based on their final numerical course grade.

  • A+: 97-100
  • A: 90-96
  • B+: 87-89
  • B: 80-86
  • C+: 77-79
  • C: 70-76
  • D+: 67-69
  • D: 60-66
  • F: 0-59

입력

The input will begin with a single line containing just a whole number, n, of the number of hobbits in the class, followed by n lines in the form a b, where a is the hobbit’s name (only alphabetical characters) and b is the hobbit’s grade, given as a whole number. The length of hobbit's name is less than 10.

출력

For each test case, print out a list of every hobbits name and letter grade, each on its own line. There should be no additional white space following test cases.

예제 입력 1

5
Bilbo 13
Sam 90
Pippin 78
Frodo 97
Merry 70

예제 출력 1

Bilbo F
Sam A
Pippin C+
Frodo A+
Merry C