Problem list
Log in
#r03685 · CCC 2014 Junior

Vote Count

Bronze III 2.0 s 256 MB

A vote is held after singer A and singer B compete in the final round of a singing competition. Your job is to count the votes and determine the outcome.

Input

The input will be two lines. The first line will contain $V~(1 \leq V \leq 15)$, the total number of votes. The second line of input will be a sequence of $V$ characters, each of which will be $A$ or $B$, representing the votes for a particular singer.

Output

The output will be one of three possibilities:

  • A, if there are more $A$ votes than $B$ votes;

  • B, if there are more $B$ votes than $A$ votes;

  • Tie, if there are an equal number of $A$ votes and $B$ votes.

Example 1

Input
6
ABBABB
Output
B

Example 2

Input
6
ABBABA
Output
Tie
Source
CCC 2014 Junior
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code