Having solved the tedious assignment, Mirko decided to play a game with his good friend Slavko.
They have written a sequence of
We define a word to be more beautiful than another word if it comes first alphabetically. The player who has the more beautiful word at the end of the game wins. If both players have equal words, they both lose.
Mirko is a much better player than Slavko, so he has decided to make it easier for Slavko by always selecting the rightmost remaining letter in the sequence. Knowing this, Slavko wants to find out if it is possible for him to win and which is the most beautiful word he can end the game with.
Input Specification
The first line of input contains an even positive integer
The second line of input contains
Output Specification
The first line of output must contain DA
if it is possible for Slavko to win, and NE
otherwise.
The second line of output must contain the most beautiful word that Slavko can have at the end of the game.
Scoring
In test cases worth
Sample Input 1
2
ne
Sample Output 1
NE
n
Sample Input 2
4
kava
Sample Output 2
DA
ak
Sample Input 3
8
cokolada
Sample Output 3
DA
acko
Comments