import java.util.Scanner;

public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String grade =scanner.next();

    //write your code here......
    
    //采用字符串比较

// if(grade.equals("A")){ // System.out.print("优秀"); // }else if(grade.equals("B")){ // System.out.print("良好"); // }else if(grade.equals("C")){ // System.out.print("及格"); // }else if(grade.equals("D")){ // System.out.print("不及格"); // }else{ // System.out.print("未知等级"); // }

    //采用字符比较
    char cha = grade.charAt(0);
    if(cha == 'A'){
        System.out.print("优秀");
    }else if(cha == 'B'){
        System.out.print("良好");
    }else if(cha == 'C'){
        System.out.print("及格");
    }else if(cha == 'D'){
        System.out.print("不及格");
    }else{
        System.out.print("未知等级");
    }
}

}