#include<bits/stdc++.h>
using namespace std;
int t;
int main(){
cin>>t;
for(int i=1;i<=t;i++){
int n;
cin>>n;
if(n>=0&&n<60){
cout<<"fail"<<endl;
}else if(n>=60&&n<80){
cout<<"pass"<<endl;
}else if(n>=80&&n<=100){
cout<<"excellent"<<endl;
}else{
cout<<"wa"<<endl;
}
}
return 0;
}