#C3392. Determine the Winner
Determine the Winner
Determine the Winner
Two players, Pia and Tony, play a game using an initial string S
. For each character in the string, count its frequency. Let \(f(x)\) denote the frequency of character \(x\). Define:
[ \text{odd_count} = #{x \mid f(x) \equiv 1 \pmod{2}} ]
The rules of the game are as follows:
- If \(\text{odd_count}\) is even (including zero), then Pia wins.
- If \(\text{odd_count}\) is odd, then Tony wins.
Given the string S
, determine which player will win the game.
inputFormat
The input consists of a single line containing the string S
.
outputFormat
Output a single line containing either Pia
or Tony
, the winner of the game.
aabcaa
Pia
</p>