Initialize a map to store the vote counts for each team at each rank.
Iterate over each vote and update the map with the rank counts for each team.
Convert the map to a list of teams, where each team has its corresponding rank counts.
Sort the list of teams based on their rank counts. If two teams have the same count at a rank, compare the next rank. If all ranks are the same, sort alphabetically.
Build the result string by concatenating the sorted team names.