Years ago at school we played a simple game with a coin. The first player calls heads or tails, then the second player tosses the coin. The first player gains a point for every correct call, and the second player gains a point for every incorrect one. Once we got bored, we added up the scores.
Given the records of several games, work out the final score of each one.
The input holds several games. Each game starts with a line of two names separated by one space, and each name is at most 20 letters. The next line holds one positive integer n, the number of recorded tosses (0<n≤1000). Then follow n lines, each with two characters separated by one space. The first character is the call and the second is the result, where H means heads and T means tails. A line containing only # # ends the input.
Print one line per game. Each line holds the first player's name exactly as it appeared in the input, that player's score, the second player's name, and that player's score, separated by single spaces.