Under construction

Still being built. Things may change

Poetry

Interview

Time limit1sMemory limit128 MB

Summary
For each four-line verse, extract the last syllable of the final word on every line and print which rhyme scheme it matches.
Level

Easy3 of 10

Topics
String, Implementation, Hash map, Simulation
Solved
No attempts yet

Problem

A simple poem consists of one or more four-line verses. Each line contains one or more words made of uppercase and/or lowercase letters, and adjacent words on a line are separated by a single space.

The last syllable of a word is the sequence of letters from its last vowel (a, e, i, o, or u; y is not a vowel) to the end of the word. If a word contains no vowel, its last syllable is the whole word. Two lines rhyme when the last syllables of their final words are equal, ignoring letter case.

For each verse, classify its rhyme form as one of perfect, even, cross, shell, or free:

  • perfect: all four lines rhyme with one another.
  • even: the first two lines rhyme, and the last two lines rhyme.
  • cross: the first and third lines rhyme, and the second and fourth lines rhyme.
  • shell: the first and fourth lines rhyme, and the second and third lines rhyme.
  • free: any verse that is not perfect, even, cross, or shell.

Check the forms in the order above: a verse is perfect if all four lines rhyme; otherwise it may be even, cross, or shell; if none of these apply, it is free.

Input

The first line contains an integer NN — the number of verses in the poem (1≤N≤51 \le N \le 5).

The next 4N4N lines contain the poem, four lines per verse in order. Each of these lines has at most 8080 characters, consisting only of letters and single spaces between words.

Output

Print NN lines. On the ii-th line, print the rhyme form of the ii-th verse: one of perfect, even, cross, shell, or free.

Examples3

  1. Example 1

    Input
    1
    One plus one is small
    one hundred plus one is not
    you might be very tall
    but summer is not
    
    Expected output
    cross
    
  2. Example 2

    Input
    2
    I say to you boo
    You say boohoo
    I cry too
    It is too much foo
    Your teacher has to mark
    and mark and mark and teach
    To do well on this contest you have to reach
    for everything with a lark
    
    Expected output
    perfect
    shell
    
  3. Example 3

    Input
    2
    It seems though
    that without some dough
    creating such a bash
    is a weighty in terms of cash
    But how I see
    the problem so fair
    is to write subtle verse
    with hardly a rhyme
    
    Expected output
    even
    free