Digit Picking

View as PDF

Submit solution


Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem types

Cansu and Deniz are two great friends (or so, historians say). They have just one little problem regarding their relationship—they always have such a hard time agreeing on whose dorm they will go to today! They both think that each other's dorm is too far away. Who's going to walk that far in the cold of Ankara winters? To reconcile this small issue, they devised a game where the loser has to come to the winner's dorm.

In this game, they are initially given a number \(n\) which has an even number of digits from \(1\) to \(9\). Each player also has a number of their own (respectively, \(c\) for Cansu and \(d\) for Deniz), initially empty. For the purposes of this problem, you can consider an "empty" number to be equal to \(0\) in value.

Cansu starts, and then they alternate moves. In one move, a player takes either the first or the last digit of \(n\) and adds it to the end of their number, and the digit that wasn't taken is added to the end of their opponent's number. Both digits are removed from \(n\) afterwards, and the game ends when \(n\) becomes empty. The winner is the player whose number is larger. If their numbers are equal, then it's a draw.

As Deniz and Cansu are both smart people, they always know which move is best for them (e. g. they both try to win, and if they can't, they try to draw). With that in mind, can you find out who's going to win today's game?

Input

The first line contains a single integer, \(m\) — the length of the number. It's guaranteed that \(m\) is even.

The next line contains a single integer \(n\) of length \(m\). It's guaranteed that there are no zeroes in \(n\).

  • \(2 \le m \le 2 \cdot 10^5\)

Output

Print the result of the game if both players play optimally. If Cansu wins, print Cansu. If Deniz wins, print Deniz. If it's a draw, print Draw.

Example

Input 1:

6
138521

Output 1:

Deniz

Input 2:

4
6776

Output 2:

Draw

Explanation

Input 1:

One of the possible games Cansu and Deniz can play:

  • Cansu picks the last digit in \(m\): \(c = 1\), \(d = 1\), \(m = 3852\)
  • Deniz picks the first digit in \(m\): \(c = 12\), \(d = 13\), \(m = 85\)
  • Cansu picks the last digit in \(m\): \(c = 125\), \(d = 138\), \(m\) is now empty.

Deniz wins because \(c = 125 < 138 = d\). Neither of the players follows any strategy in this particular exemplary game, so it doesn't show that Deniz wins if both play optimally.