The Problem of the Crazy Linguist

Please, help the crazy linguist! He is trapped in his madness. He has developed a “Spanish Beauty Criterion” for words. It is defined as follows. Given a word w w = x1x2x3 ...xn (where n is the length of the word), he is interested in words which are formed by letters following pattern: { xi ∈ {bcdfghjklmnpqrstvwxyz} if i is odd {aeiou} if i is even and, also, in his madness, he won’t allow a word that actually has i, j, and k, so that xi = xj = xk (that is, any letter can appear in the word at most two times). Then, the “Spanish Beauty Criterion” (SBC) is defined as: ∑ SBC(w) = where P is defined as the probability of appearance of a letter in Spanish, defined by the following table: So, given a word w, of size n, our poor linguist wants to know if this word is above or below the average of the SBC of all the words of size n that can be constructed following the above pattern and start with the same letter than w. Input The input will have a first line with a number, N, the number of samples that will be entered to know if they are above or below the average. Following this first line, N lines with a word in each one (of at most seven characters each). All the input words follow the given pattern. Output The output will have N lines, each line corresponding to one input word in order, showing just ‘above or equal’ or ‘below’, depending on the value of the SBC of that word relative to the average of those of the same size. Sample Input 5 bubu terabit hacer qed loco i∈1...n abcdefghijklm 12.53 1.42 4.68 5.86 13.68 0.69 1.01 0.70 6.25 0.44 0.00 4.97 3.15 nopqrstuvwxyz 6.71 8.68 2.51 0.88 6.87 7.98 4.63 3.93 0.90 0.02 0.22 0.90 0.52 i ∗ P(xi)

2/2 Sample Output below above or equal above or equal above or equal above or equal