One day at their grandparents' house, Ana and Beto found a very strange deck of cards. This deck consisted of $$$M$$$ cards, each containing an integer, some of which were repeated. Not knowing what the cards were for, they decided to invent a game to pass the time. The rules of the game are as follows:
Ana starts the game by choosing a card from the deck and writing down its number.
Then, they take turns playing alternately, each choosing an unplayed card from the deck such that its sum with the number written down by the other player in the previous turn is a power of two minus one. That is, if the number written down by the other player in the previous turn is $$$x$$$, then the current player must choose a card with a number $$$y$$$ such that $$$x + y = 2^k - 1$$$ for some integer $$$k \gt 0$$$. Once chosen, they write down the number $$$y$$$.
The game ends when a player cannot choose a card that satisfies the above condition. The player who cannot choose a card on their turn loses the game.
Given the initial deck of cards, determine who will win the game assuming both players play optimally.
The first line contains an integer $$$N$$$ ($$$1 \le N \le 10^{6}$$$), the number of distinct values on the cards in the deck.
The $$$i$$$-th of the following $$$N$$$ lines contains two integers $$$A_i$$$ and $$$C_i$$$ ($$$1 \le A_i, C_i \le 10^{9}$$$), indicating that there are $$$C_i$$$ cards with the number $$$A_i$$$ written on them. The total number of cards in the deck is $$$M=C_1+C_2+\ldots +C_N$$$.
It is guaranteed that all $$$A_i$$$ are pairwise distinct and sorted in strictly increasing order, that is, $$$A_1 \lt A_2 \lt \dots \lt A_N$$$.
A single line containing the name of the winning player if both play optimally: Ana if Ana wins, or Beto otherwise.
32 15 210 1
Beto
41 32 13 24 3
Ana
In the first example, the deck consists of the cards $$$[2, 5, 5, 10]$$$. If Ana chooses the card with $$$10$$$, then Beto chooses one of the cards with $$$5$$$ (he can do so since $$$5+10=15=2^4-1$$$). Next, Ana can only choose the card with $$$2$$$ (since $$$5 + 2 = 7 = 2^3 - 1$$$ and $$$5 + 5 = 10$$$, which is not a power of two minus one), and Beto chooses the other card with $$$5$$$. At this point, Ana cannot choose any card because there are no cards left in the deck, so Beto wins. It can be shown that if Ana chooses a different card on her first turn, Beto also has a winning strategy.
In the second example, the deck consists of the cards $$$[1, 1, 1, 2, 3, 3, 4, 4, 4]$$$. Ana can win if she chooses a $$$1$$$ on her first turn.