electicode
HomeCoursesResourcesProblemsNational OlympiadContestsLeaderboard
...

Alice and Bob playing an easy game

Time Limit: 1000msMemory Limit: 256MB
View EditorialView Submissions

Problem Description

Alice and Bob are playing a game that consists of NNN rounds. For each round, exactly one of them wins.

The number of rounds NNN is odd, so it is guaranteed that there will be no tie in the total number of rounds won.

Your task is to determine who wins the game overall — the player who wins more rounds.

Input Format

The first line contains a single integer NNN (1≤N≤91 \leq N \leq 91≤N≤9) — the number of rounds.

The second line contains NNN characters, each being either:

  • A — Alice won that round
  • B — Bob won that round

Output Format

Print one line consisting of "Alice" if Alice won more rounds — "Bob" otherwise.

Scoring

SubtasksAdditional constraintsPointsRequired Subtasks
000Sample000—
111N=1N = 1N=1

Examples

Example 1
Input
3
ABA
Output
Alice
Example 2
Input
1
B
Output
Bob

© 2026 Electicode. All rights reserved.

404040
—
222—6060600,10,10,1