Problem I
Flower Bracelets
Flora likes to make virtual flower bracelets in her spare time. The bracelets are made of six different kinds of pieces: butterfly, daisy, sunflower, rose, hibiscus, and clover. While each flower bracelet is unique, their design follows a set of rules, which is shown below:
The rules must be read left to right, and the | symbol denotes “or” when $2$ or more choices can apply.
Counterfeit bracelets, however, do not follow these rules.
Write a program to distinguish authentic flower bracelets from counterfeit ones!
To simplify your task, we will represent bracelet pieces using lowercase letters according to the following key:
Input
The input consists of multiple test cases. The first line contains an integer $n$ ($1 \le n \le 100$) denoting the number of test cases. This is followed by $n$ lines, each containing a string $s$ of between $1$ and $100$ English lowercase characters.
Output
Output $n$ lines containing either authentic or counterfeit depending on whether the $i^\texttt {th}$ given string represents an authentic bracelet or not.
Sample Input 1 | Sample Output 1 |
---|---|
12 bssddssdrrrhdddcc brssdssddddhdddddcc brrssrssdrdhddcc bssdrrrdddhddddcc bdssdddrrrhddddcc bdssdssssrrhddcc bdssrdddddhddddddcc bssdssssddsshdddcc brrssdssssrsshdcc bdrssssssrsshdcc bdssssssrrdsshddcc bddrdrrdsshddddcc |
authentic authentic authentic authentic authentic authentic authentic authentic authentic authentic authentic authentic |
Sample Input 2 | Sample Output 2 |
---|---|
13 bssdssdrrrhdddcc brssdssddhddhdddddcc brrssrssdrddhdcc bssdrrddddhddddcc bdsdsddrrrrhddddcc bdssdshhsssrrhddcc bssdssddssddsshdddcc brresdssssrsshdcc brdsrhhsssssrsshdcc bdssssrrdsshdcc ddrdrrdsshddddcc brrssdssssrsshdc brrssdssssrsshd |
counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit counterfeit |