#include <iostream>
#include <string>
using namespace std;
int main()
{
string a;
while (cin >> a) {
int b[26]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26}, c[26]={27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52},chr=a.size(), num=0, kk=0;
for (int i=0;i<chr;i++) {
if (a[i]>96) {
num+=b[a[i]-96];
}
else {
num+=c[a[i]-64];
}
}
for (int i=1;i<=num;i++) {
if (num%i==0) {
kk+=1;
}
}
kk>2 ? cout << "It is not a prime word." << endl : cout << "It is a prime word." << endl;
}
}