#include<iostream>
using namespace std;
int main(){
/* long long n,x,sum;
cin>>n;
for(int i=1;i<=n;i++){
cin>>x;
sum=0;
for(long long j=1;j<=x/2;j++) {
if (x%j==0) sum=sum+j;
}
if (sum==x) cout<<x<<" is perfect"<<endl;
else cout<<x<<" is not perfect"<<endl;
}
*/
int t,n;
cin>>t;
while(t--){
cin>>n;
if(n==6||n==28||n==496||n==8128||n==33550336)
cout<<n<<" is perfect"<<endl;
else cout<<n<<" is not perfect"<<endl;
}
return 0;
}
那个long long 也是会超时