Under construction

Still being built. Things may change

Angry Changyoung

Interview

Time limit1sMemory limit128 MB

Summary
For each match length, decide if it fits diagonally inside a W by H rectangle and print DA or NE accordingly.
Level

Easy2 of 10

Topics
Geometry, Math, Implementation
Solved
No attempts yet

Problem

Changyoung angrily threw several matches onto the floor. The matches now need to be collected in a rectangular box.

The bottom of the box is a rectangle with width W and height H. A match can be put into the box only if the whole match can lie flat on the bottom of the box. For each match length, determine whether that match can fit in the box.

Input

The first line contains the number of thrown matches N, the width W of the box, and the height H of the box. (1 <= N <= 50, 1 <= W, H <= 100)

Each of the next N lines contains one match length. Every length is an integer between 1 and 1000, inclusive.

Output

For each match in the input order, print DA if it can fit in the box, and print NE otherwise.

Examples2

  1. Example 1

    Input
    5 3 4
    3
    4
    5
    6
    7
    
    Expected output
    DA
    DA
    DA
    NE
    NE
    
  2. Example 2

    Input
    2 12 17
    21
    20
    
    Expected output
    NE
    DA