Tram, trolleybus, and bus drivers talk at the tram forum. We have read all
messages posted at the forum during last month and discovered an interesting
rule. Users in whose messages the word “tram” occurs more often
than the word “trolleybus” are tram drivers. Similarly, users in
whose messages the word “trolleybus” is more frequent than the word
“tram” are trolleybus drivers. All other users of the tram forum
are bus drivers. Given this information, can you determine who has posted the
latest message at the tram forum?
You are given the latest message at the tram forum. The
message consists of lowercase English letters, spaces, line breaks, and
punctuation marks: periods, commas, dashes, colons, and exclamation and
question marks. The total length of the message is at most 10000 symbols. Words
consist of letters and can be separated by spaces, line breaks, and punctuation
Output “Tram driver” if the user who has
posted the latest message is a tram driver; output “Trolleybus
driver” if she is a trolleybus driver; and output “Bus
driver” if she is a bus driver.
of course, tram is the best transport
in the world!
yes, yekaterinburg trams are the
best trams in the world, but
i like my trolleybus too.
read forum.tr.ru every day!
you can learn much about tram
drivers and trolleybus drivers.
Problem Author: Alexander Ipatov (prepared by Denis Musin)
Problem Source: The 12th Urals Collegiate Programing Championship, March 29, 2008