Little Leticija is preparing for a programming exam. Even though she has solved a lot of tasks, there's one still left unsolved, so she is asking you for help.
You are given the word
Let's say that word
Input Specification
The first line of input contains the word
The second line of input contains the positive integer
Each of the following
Output Specification
For each query, output DA
(Croatian for yes) if it is possible, and NE
(Croatian for no) if it is not.
Scoring
In test cases worth
Sample Input 1
kileanimal
2
2 2 7 7
1 4 6 7
Sample Output 1
DA
NE
Sample Input 2
abababba
2
3 5 1 3
1 2 7 8
Sample Output 2
DA
DA
Sample Input 3
vodevovode
2
5 8 3 6
2 5 3 6
Sample Output 3
NE
DA
Explanation for Sample Output 3
In the first query, vovo
, and devo
. In the second query, odev
, and devo
.
Comments