var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var data = input.split( '\n' );
  var output = [];
  for( var i=0; i<data.length; i++ ) {
    var mfr = data[i].split( ' ' );
    var m = parseInt( mfr[0] );
    var f = parseInt( mfr[1] );
    var r = parseInt( mfr[2] );
    
    if( -1 == m && -1 == f &&  -1 == r ) { break; }
    
    var sum = m+f;
    if( -1 == m || -1 == f ) {
      output.push( "F" );
    } else if( 80 <= sum ) {
      output.push( "A" );
    } else if( 65 <= sum && sum < 80 ) {
      output.push( "B" );
    } else if( 50 <= sum && sum < 65 ) {
      output.push( "C" );
    } else if( 30 <= sum && sum < 50 ) {
      if( 50 <= r ) {
        output.push( "C" );
      } else {
        output.push( "D" );      
      }
    } else {
      output.push( "F" );
    }
  }
  console.log( output.join( '\n' ) );
});