## LCC/Moose '20 Contest 3 S1 - Peculiar Polling

View as PDF

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

After losing the election for CEO of MCPT to Erfan, Theodore, furious of his loss, has decided to sue MCPT over voter irregularities. In his case, Theodore argues that a candidate gaining more than one consecutive vote is evidence that the voting machine has been tampered with (an irregularity) and only should be counted.

To see if this case's merits should be heard, the court has asked you to perform an audit using Theodore's description of an irregularity and to report the new totals.

#### Input Specification

The first line consists of a single integer, , the number of votes counted.

The second consists of ASCII capital letters, the votes cast before auditing. Each character represents a vote cast for the candidate of that character.

#### Output Specification

For each candidate who received more than vote output a single line containing the name of the candidate and the number of votes they separated by a space.

The order in which the candidates appear is irrelevant.

#### Sample Input 1

20
ABBABBABBABBABBABBAA

#### Sample Output 1

A 7
B 6

#### Sample Input 2

50
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

#### Sample Output 2

T 1