#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
int sum=0;
while(cin>>n&&n!=0)
{
int m=n;
while(n--)
{
if(n!=0 && m%n==0)
{
sum+=n;
}
}
cout<<setiosflags(ios::fixed)<<setiosflags(ios::right)<<setprecision(2);
if(n==sum)
cout<<setw(5)<<n<<" "<<"Perfect"<<endl;
else if(n>sum)
cout<<setw(5)<<n<<" "<<"Deficient"<<endl;
else if(n<sum)
cout<<setw(5)<<n<<" "<<"Abundant"<<endl;
}
return 0;
}
/*
哪里错了 T-T
就是不对呢
*/