data Badge = NA | E | D | C | B | A | AA | AAA deriving (Show)

main :: IO ()
main = interact $ unlines.map (show.(\[a,b] -> badgeTest a b).map read.words).lines

badgeTest :: Double -> Double -> Badge
badgeTest half kilo
    | half < 35.50 && kilo < 71.00  = AAA
    | half < 37.50 && kilo < 77.00  = AA
    | half < 40.00 && kilo < 83.00  = A
    | half < 43.00 && kilo < 89.00  = B
    | half < 50.00 && kilo < 105.00 = C
    | half < 55.00 && kilo < 116.00 = D
    | half < 70.00 && kilo < 148.00 = E
    | otherwise                     = NA
