A0001. Cool lines P56059


Statement
 

pdf   zip

thehtml

A line of words is cool if its first word, word in the middle and last word are identical.

Your task is to write a program that reads various lines, and prints if all the lines are cool, if there is not any cool line, or if there are some lines that are cool and some that are not.

Input

The input is a sequence of one or more lines. Each line starts with a natural number that indicates its number of words. If this number is even, the middle word does not exist, therefore the line cannot be cool. After the natural number, each line has, at least, two words.

Output

The program has to print “all cool”, “none cool” or “both types” depending on the case.

Public test cases
  • Input

    7 a b b a b b a
    5 hello bye hello bye hello
    

    Output

    all cool
    
  • Input

    3 cat dog cat
    3 x x x
    3 hi hi hi
    

    Output

    both types
    
  • Input

    4 house house house house
    5 a b a b c
    

    Output

    none cool
    
  • Information
    Author
    Professorat de P1
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++ Java