What Is My Grade?

Interview

Time limit1sMemory limit256 MB

Summary
Given 50 distinct scores sorted in descending order and Hongik's score, print the letter grade matching his rank using the fixed cutoffs.
Level

Easy2 of 10

Topics
Array, Implementation, Sorting, Binary search
Solved
No attempts yet

Problem

Hongik, a third-year student, took Operating Systems (OS), a required course for his major, this semester. After the course ended, the professor converted everyone's midterm, final, and assignment scores to a 300-point scale and posted them on Classnet. Staring blankly at the scores, Hongik suddenly remembered that he absolutely has to receive a scholarship.

"If I don't get at least an A0 in Operating Systems, it will be hard to get the scholarship..."

On the first day of the Operating Systems class, the professor explained the grade distribution as follows.

  • A+: ranks 1 to 5
  • A0: ranks 6 to 15
  • B+: ranks 16 to 30
  • B0: ranks 31 to 35
  • C+: ranks 36 to 45
  • C0: ranks 46 to 48
  • F: ranks 49 to 50

The professor displayed the students' final scores sorted in descending order on the Classnet real-time information page.

Grades will be announced through Classnet in 10 days, but Hongik cannot wait that long, so he wants to find out his grade with a program. Help Hongik determine his grade!

Input

The first line gives the scores of 50 students, including Hongik's score, separated by spaces. The scores are sorted in descending order, and no two scores are equal.

The second line gives Hongik's score.

Every score is an integer between 0 and 300 inclusive.

Output

Print Hongik's grade on the first line.

Examples3

  1. Example 1

    Input
    285 271 270 268 264 251 237 236 228 227 226 225 224 217 216 205 198 193 192 190 182 168 165 161 157 146 141 135 127 126 122 114 105 81 80 76 70 67 63 59 55 44 34 24 19 14 9 5 2 1
    251
    
    Expected output
    A0
    
  2. Example 2

    Input
    299 293 291 288 287 286 278 276 275 269 262 260 244 239 236 232 213 209 204 199 197 184 179 178 175 170 167 166 162 158 141 130 128 124 115 111 108 105 63 60 57 54 49 44 40 34 17 11 4 3
    4
    
    Expected output
    F
    
  3. Example 3

    Input
    300 293 292 289 285 281 273 271 261 255 236 233 230 226 224 219 216 210 207 206 193 191 190 182 169 163 161 159 157 154 153 148 143 137 134 121 108 100 87 76 71 59 46 45 38 25 20 4 3 1
    148
    
    Expected output
    B0