def score(m, f, r)
  return 'F' if m == -1 || f == -1
  return 'A' if m + f >= 80
  return 'B' if m + f >= 65
  return 'C' if m + f >= 50
  if m + f >= 30
    return 'C' if r >= 50
    return 'D'
  end
  'F'
end

data = []
loop do
  d = gets.split.map(&:to_i)
  break if d == [-1, -1, -1]
  data << d
end

data.each do |d|
  puts score(*d)
end