407172: GYM102697 143 Zoom Meeting
Description
You're attending an international Zoom call during the Coronavirus quarantine, where the attendees represent many different countries. The zoom call is really long, and to pass the time, you tally how many people are from each country.
Given the list of people and their countries, print the countries, and how many meeting attendees are from each country. Sort the countries first by their number of attendees, and if two countries have an equal number of attendees, sort them alphabetically by the name of the country.
InputThe first line of input contains a single positive integer $$$n$$$: the number of meeting attendees.
The next $$$n$$$ lines each contain a single country name $$$c$$$.
OutputIf there are less than five lines of input, output $$$n$$$ lines: each country, and it's number of meeting attendees, separated by a space.
Otherwise, output 5 lines: each of the top 5 countries using the sorting method described above, and it's number of meeting attendees, separated by a space.
ExamplesInput11 USA Sweden Argentina Cameroon Egypt Australia England France Russia Mongolia IndiaOutput
Argentina 1 Australia 1 Cameroon 1 Egypt 1 England 1Input
4 USA USA Mexico MexicoOutput
Mexico 2 USA 2Input
9 USA Germany Brazil China USA China China USA USAOutput
USA 4 China 3 Brazil 1 Germany 1