LCC '21 Contest 6 J2 - Batrick's Ballad

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Over the weekend, Patrick has written a ballad with N 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, N (1 \le N \le 100).

The next N lines will each contain a string S (1 \le |S| \le 100) representing the syllables of the line.

Output Specification

For each of the N lines, output one line containing PASS if trochaic tetrameter is satisfied and FAIL otherwise.

Sample Input

3
/./././
././.
//.././

Sample Output

PASS
FAIL
FAIL

Comments

There are no comments at the moment.