// بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ //
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double dol;
#define pi acos(-1)
#define opscode()                     \
    ios_base::sync_with_stdio(false); \
    cin.tie(nullptr);

string s;
void samsolveit()
{
    ll nc = 0;

    for (char ch : s)
    {
        if ('A' <= ch && ch <= 'Z')
            nc += (ch - 'A' + 27);
        else
            nc += (ch - 'a' + 1);
    }

    if (nc == 1)
    {
        cout << "It is not a prime word.\n";
        return;
    }

    for (ll i = 2; i * i <= nc; i++)
    {
        if (!(nc % i))
        {
            cout << "It is not a prime word.\n";
            return;
        }
    }

    cout << "It is a prime word.\n";
}

/*
Ebnesamit
*/
int main()
{
    opscode();
    while (cin >> s)
    {
        samsolveit();
    }
    return 0;
}