#include <iostream>
#include <string>
#include <algorithm>
#include <cctype>


bool is_valid_word(const std::string& word)
{
    return std::all_of(word.begin(), word.end(), isalpha);
}

int main()
{
    std::string word;
    std::cin >> word;
    while(!is_valid_word(word)) {
        std::cout << word << " is not a valid word\n";
        std::cin >> word;
    }
    std::cout << word << " is valid!";
}
