let () = 
	let g (m, f, r) = 
		if m = -1 || f = -1 then "F"
		else (
			let s = m + f in
			if      s < 30 then "F"
			else if s < 50 then
				if r < 50 then  "D"
				else            "C"
			else if s < 65 then "C"
			else if s < 80 then "B"
			else                "A"
		) in
	let rec solve _ =
		let (m, f, r) = Scanf.scanf "%d %d %d\n" (fun x y z -> (x, y, z)) in
		match (m, f, r) with
			| (-1, -1, -1) -> ()
			| p -> Printf.printf "%s\n" @@ g p; solve ()
	in solve ();;
