#include <iostream>
#include <string>
using namespace std;
string sc(int score) {
if (score >= 90 and score <= 100) return "优秀";
if (score >= 80 and score <= 89) return "良";
if (score >= 70 and score <= 79) return "中";
if (score >= 60 and score <= 69) return "及格";
if (score >= 0 and score <= 59) return "差";
else return "成绩不合法";
}
int main() {
int score;
cin >> score;
// write your code here......
cout << sc(score) << endl;
return 0;
}