Abdul has created a naming convention for places (countries, cities, streets, etc.). Words are composed of sections. There are three valid types of sections: A, B and C. The following elements are categorized into section A:
r. The following elements are categorized into section B:
oo. Finally, the following elements are categorized into section C:
f. Valid words are composed of sections that follow strict placement rules. A word may start with either section A or B. A word must be at least 2 sections in length. A word cannot have two consecutive sections of the same type. A word must end with either section A or C. Section C can only end a word, and thus not exist anywhere else. A name consists of two or more words. The case is not relevant.
Given a name, check whether or not it is a valid name, according to the naming convention explained above. If it is valid, output
valid otherwise, output
A single line with a name containing words. Each word has letters.
invalid depending on whether the name given was a valid or invalid name according to Abdul's naming convention.
Sample Input 1
Sample Output 1
Sample Input 2
Sample Output 2
Explanation for Sample Output 2
First of all, the word "Abdul" is not a valid word. Secondly, there is only 1 word in the name.