Given n matches of football teams and their opponents, you are asked to find out the number of matches each team played.
The first line of the input contains a single integer n - the number of matches. The next n lines contain dash (-) separated team names that played against each other. The following line contains comma-separated (,) names of the clubs for which the program should print the number of matches played.
The program should print space-separated numbers of matches for each of the teams requested on the last line of the input.