Over the weekend, Patrick has written a ballad with lines for his English assignment. Now, he would like you to help him check over all of the lines so that he can get a good mark.
Specifically, Patrick would like you to check over the syllables of each line to make sure that it conforms to trochaic tetrameter. For each line, he will give you a string containing only /
and .
characters. In the string, /
represents a stressed syllable and .
represents an unstressed syllable.
According to Patrick's teacher, there are three rules that a line must satisfy to conform to trochaic tetrameter. First, it must start with a stressed syllable. Second, it must contain exactly four stressed syllables. Finally, no two stressed syllables may be directly next to each other.
Please help Patrick verify his ballad by printing, for each line, PASS
if the line satisfies trochaic tetrameter and FAIL
otherwise.
Input Specification
The first line will contain an integer, .
The next lines will each contain a string representing the syllables of the line.
Output Specification
For each of the lines, output one line containing PASS
if trochaic tetrameter is satisfied and FAIL
otherwise.
Sample Input
3
/./././
././.
//.././
Sample Output
PASS
FAIL
FAIL
Comments