Notice the unusual time limit.
Alice, Bob and Carol are good friends. They are playing a exciting game called "Pass Ball Ball". They have a ball ball and they pass it until the music stops.
They stand in a straight line. Alice holds the ball at the first second (i.e. $T=1$). They pass the ball every second from Alice to Bob to Carol, then from Carol to Bob to Alice, and repeat until the music stops as below.
$T$ | $1$ | $2$ | $3$ | $4$ | $5$ | $6$ | ... |
Ball at | Alice | Bob | Carol | Bob | Alice | Bob | ... |
Who holds the ball when the music stops at the $T$-th second?
Input
The only line of the input contains one integer: $T$.
Output
Output the name of the person (Alice
, Bob
, or Carol
) who holds the ball when the music stops.
Constraints
Subtask 1 (30%): $1\le T\le 10$
Subtask 2 (30%): $1\le T\le 10^5$
Subtask 3 (40%): $1\le T\le 2^{31}-1$
Sample Test Cases
Input | Output | |
---|---|---|
4 | Bob | |
The ball is passed from Alice to Bob to Carol and back to Bob. | ||
6 | Bob | |
Ball movement: Alice -> Bob -> Carol -> Bob -> Alice -> Bob. |
Scoring: Per Subtask
Authored by hclee and s17r28
Appeared in 2023 Wah Yan Interschool Olympiad in Informatics 🤯🥷⚡🧠🏆