
In Croatia there are
To solve this noise problem, the radio station owners are asking you to write a program which simulates the actions of the radio stations. Your program needs to support two types of queries:
S x
: If not currently broadcasting, the station with frequency starts broadcasting, and if it is already broadcasting, it stops.C l r
: Check if there exists a pair of broadcasting stations whose frequencies and are from the interval and such that . If such a pair exists, printDA
, otherwise printNE
.
Initially, no station is broadcasting.
Input Specification
The first line contains positive integers
The
Output Specification
Print the answers to the queries of the second type in order, in separate lines.
Constraints
Subtask | Points | Constraints |
---|---|---|
For all queries of the second type it holds that | ||
Sample Input 1
6 8
S 1
S 2
S 3
C 1 6
S 6
C 1 6
S 2
C 1 6
Sample Output 1
NE
DA
DA
Explanation for Sample Output 1
The stations broadcasting during the first C
type query are
Sample Input 2
11 6
S 4
S 10
C 3 11
C 2 7
S 6
C 2 7
Sample Output 2
DA
NE
DA
Sample Input 3
20 7
S 10
S 15
S 3
C 10 15
S 10
C 3 15
C 3 10
Sample Output 3
DA
DA
NE
Comments