Problem 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 2s
s.trill
: This is represented in text astr
, followed by some non-zero amount ofi
s, and at least 2l
s.burble
: This is represented in text asb
, followed by some non-zero amount ofu
s, followed by some non-zero amount ofr
s, followed by ab
, followed by some non-zero amount ofl
s, 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.
his
does not have twos
s.trlll
needs at least 1i
.burbble
repeats ab
when it should not.hello
kind 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