#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin()
#define en end()
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int main()
{
Faster;
int n, w, h;
cin >> n >> w >> h;
if(w > h) swap(w, h);
int test = sqrt(w*w + h*h);
while(n--)
{
int x; cin >> x;
if(x <= test) cout << "DA";
else cout << "NE";
cout << el;
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4oKQojZGVmaW5lIGVuIGVuZCgpCiNkZWZpbmUgRmFzdGVyIGNpbi50aWUoMCk7IGNvdXQudGllKDApOyBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoKaW50IG1haW4oKQp7CiAgICBGYXN0ZXI7CiAgICBpbnQgbiwgdywgaDsKICAgIGNpbiA+PiBuID4+IHcgPj4gaDsKICAgIGlmKHcgPiBoKSBzd2FwKHcsIGgpOwogICAgaW50IHRlc3QgPSBzcXJ0KHcqdyArIGgqaCk7CiAgICB3aGlsZShuLS0pCiAgICB7CiAgICAgICAgaW50IHg7IGNpbiA+PiB4OwogICAgICAgIGlmKHggPD0gdGVzdCkgY291dCA8PCAiREEiOwogICAgICAgIGVsc2UgY291dCA8PCAiTkUiOwogICAgICAgIGNvdXQgPDwgZWw7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=