Meow Meow
View as PDFProblem Statement
Digger and Rykker (pictured below, taking a break from meowing) like to make noise.

We've categorised the noises they make as follows:
hiss: This is represented in text ashi, followed by at least 2ss.trill: This is represented in text astr, followed by some non-zero amount ofis, and at least 2ls.burble: This is represented in text asb, followed by some non-zero amount ofus, followed by some non-zero amount ofrs, followed by ab, followed by some non-zero amount ofls, followed by ane.
We want you to write a program to recognise these.
Input
Your first line of input will be a single integer : the number of noises made.
Next, lines will follow, each containing a single string
: the noise made by either Digger and Rykker or a human.
Output
For each , if it is a
hiss, trill, or burble noise, output hiss, trill or burble, respectively, on its own line.
If is none of these, output
human noises instead.
Constraints
For all test cases...
- Each
only contains English lower-case alphabet letters.
Example
Input
7
hisss
triiilll
buuurrrbllle
his
trlll
burbble
hello
Output
hiss
trill
burble
human noises
human noises
human noises
human noises
Explanation
The first lines fit their respective definitions.
hisdoes not have twoss.trlllneeds at least 1i.burbblerepeats abwhen it should not.hellokind of just...does not fit into any of the specified categories.
Python Template
t = int(input())
a = [input() for _ in range(t)]
# Continue your code here and print your final answer!
Solution
If you'd like to view a sample solution to this tutorial question, please click the "Read Editorial" link to the right of the problem!
Comments