Problem

7 /19


Dairy stores

Problem

The dairy stores in City X sell sour cream with a fat content of 15, 20 and 25 percent. In city X, prices for sour cream were monitored. Write a time and memory efficient program that will determine for each type of sour cream how many stores sell it the cheapest. The program is first given the number of stores N. Each of the following N lines contains information in the following format:
<Company> <Street> <Fat content> <Price>
where <Company> – a string of no more than 20 characters without spaces, <Street> – a string of no more than 20 characters without spaces, <Boldness> – one of the numbers – 15, 20 or 25, <Price> – an integer in the range from 2000 to 5000, indicating the cost of one liter of sour cream in kopecks.
<Company> and <Street>, <Street> and <Fat> as well as <Fat> and <Price> separated by exactly one space.

Input string example:
Crossroads Korolenko 25 3200

The program should display space-separated 3 numbers – the number of shops selling sour cream with a fat content of 15, 20 and 25 percent is the cheapest. If some kind of sour cream was not sold anywhere, then print 0.

Sample output:
12 10 0