Odd and Even have long enjoyed a certain number game together, and they were having a great time playing it.
The game starts from an arbitrary natural number. The two players take turns, and on your turn you may either add 1 to the current number or divide the current number by some prime. The result of a division must always be a natural number. Whoever turns the number into 1 wins the game.
One sunny day, Odd and Even made a new friend named Changyeong. To play together as a group of three, they extend the rules.
Now, winning earns points. Each person's score is the smallest number they made during the game. If a player's turn never came around before the game ended, then the number the game started from becomes that player's score.
The three of them dislike quarreling, so rather than trying to win they focus solely on making their own score as small as possible. Moreover, when several choices would lead to the same score, each player picks the choice whose resulting number is smallest.
Turns always proceed in the order Odd → Even → Changyeong → Odd → …, but the player who starts may differ from game to game.
For each game you are given who starts and the number the game starts from. Assuming all three always play optimally, compute each player's final score after all games are finished.
For example, suppose Even starts and the starting number is 15. Then Even makes 16, Changyeong makes 8, Odd makes 4, Even makes 2, and Changyeong makes 1. The smallest number each of them made is 4 for Odd, 2 for Even, and 1 for Changyeong, so the scores for this game are Odd 4, Even 2, and Changyeong 1.
The first line contains the number of games $n$ that the three of them played. ($1 \le n \le 1000$)
Each of the next $n$ lines contains the player who starts a game and the number the game starts from. It is O if Odd starts, E if Even starts, and I if Changyeong starts; the starting number is between $1$ and $10000$ inclusive. (If the starting number is $1$, all three players score $1$.)
On the first line, print the final scores of Odd, Even, and Changyeong, in that order, after all games are finished. Each player's final score is the sum of the scores obtained across all games.