1596.Fake Nim

Time Limit: 1s Memory Limit: 256MB

There are two people named DaDa and TuTu. DaDa and TuTu are very close friends and usually play some interesting games (and maybe a little boring). One day they saw a store with $n$ piles of candy, each with $a_i$ candy. They wanted to buy it all, but they were too poor to buy all the candy at once. In fact, only one of them can come to the store every day (DaDa buys on the first day), and DaDa can only buy an even number of candy from a pile at a time, and TuTu can only buy odd candy from a pile at a time. In other words, on the first day DaDa will buy an even number of candy from a pile in the store, and the next day TuTu will buy an odd number of candy from a pile in the store, and then buy candy alternately. (Note: if one day DaDa finds that the number of any pile of candy is less than two, then he will not buy any candy on that day. ).

Unsurprisingly, they took buying candy as a game and agreed that whoever bought the last candy in the store would be the winner of the game.

Their conversation was inadvertently heard by you as the boss, so do you know who will win the game? (of course, DaDa and TuTu are the smartest people in the world, and they will make their own best decisions.).

Input Format(From the terminal/stdin)

The first line contains one integer $n$, represents that there are $n$ piles of candy at the beginning.
The next nlines, each line contains one integer $a_i$, represents the number of candy in the $i$-th pile.
Data guarantee: $1≤n≤50000 , 1≤a_i≤2 \times 10^{18}$.

Output Format(To the terminal/stdout)

Output a string: If DaDa wins, output "DaDa", otherwise output "TuTu".

Sample Input 1

Copy
1
999999999
 \n
         \n

Sample Output 1

Copy
TuTu
    \n

Sample Input 2

Copy
2
2
1
 \n
 \n
 \n

Sample Output 2

Copy
TuTu
    \n

Hints

In the first case, TuTu can buy all the candy the next day.
In the second case, DaDa can only buy two candies on the first day, So TuTu can buy the last candy the next
day.

Source: 2019 HNU新生赛

Submit

请先 登录

© 2025 FAQs