let () =
  let rec loop () =
    let a,b,c = Scanf.sscanf (read_line ()) "%d %d %d" (fun a b c -> a,b,c) in
    if a = -1 && b = -1 && c = -1 then ()
    else
      begin
        let grade =
          if a = -1 || b = -1 then 'F'
          else if a + b >= 80 then 'A'
          else if a + b >= 65 then 'B'
          else if a + b >= 50 then 'C'
          else if a + b >= 30 then if c >= 50 then 'C' else 'D'
          else 'F'
        in
        Printf.printf "%c\n" grade;
        flush stdout;
        loop ();
      end
  in
        
  loop ()
;;
