By Gabriel Duarte, UNIFESO Brazil
In this issue you will find a set of several words, and you have to say if the set is good or bad (Conjunto Bom or Conjunto Ruim, respectively). By definition, a set is bad when one word of this set is a prefix of another word. Otherwise, this is considered a good set.
For example, {abc, dae, abcde} is a bad set, because abc is a prefix of abcde. When two words are equal, we defined that one word is a prefix of the other.
The input contains several test cases. The first line of each test case will an integer N (1 ≤ N ≤ 10⁵) representing the number of words in the set. It follows then N rows each having a word of at most 100 lowercase letters. The entry ends when N = 0 and is not to be processed.
For each test case you should print Conjunto Bom or Conjunto Ruim, as explained above.
Input Sample | Output Sample |
3 |
Conjunto Ruim |