#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
using namespace std;
const int maxn = (int)4e5 + 10;
const int mod = (int)1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, x1[maxn / 4], x2[maxn / 4], y11[maxn / 4], y2[maxn / 4], a, b,
    t[4][maxn], M;
vector<int> vals;
inline void upd(int type, int pos, int val) {
  for (; pos < M; pos |= (pos + 1)) t[type][pos] += val;
}
inline int get(int type, int r) {
  int res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) res += t[type][r];
  return res;
}
inline int get(int type, int l, int r) {
  return get(type, r) - get(type, l - 1);
}
struct node {
  node *l, *r;
  int pr, sz, key, lz;
  node() {
    l = r = NULL;
    pr = sz = key = lz = 0;
  }
  node(int _key) {
    key = _key;
    l = r = NULL;
    sz = 1;
    lz = 0;
    pr = uniform_int_distribution<>(0, mod)(rng);
  }
};
typedef node *pnode;
pnode root[4][maxn];
inline int sz(pnode t) { return t ? t->sz : 0; }
inline pnode copy(pnode t) { return new node(t->key); }
inline void upd_sz(pnode &t) {
  if (t) t->sz = sz(t->l) + 1 + sz(t->r);
}
void split(pnode t, pnode &l, pnode &r, int key) {
  if (!t) {
    r = l = NULL;
    return;
  }
  if (t->key <= key)
    split(t->r, t->r, r, key), l = t;
  else
    split(t->l, l, t->l, key), r = t;
  upd_sz(l);
  upd_sz(r);
}
void merge(pnode &t, pnode l, pnode r) {
  if (!l || !r)
    t = l ? l : r;
  else if (l->pr > r->pr)
    merge(l->r, l->r, r), t = l;
  else
    merge(r->l, l, r->l), t = r;
  upd_sz(t);
}
inline void insert(pnode &t1, pnode t2) {
  pnode tl, tr;
  split(t1, tl, tr, t2->key);
  merge(tl, tl, copy(t2));
  merge(t1, tl, tr);
}
int get(pnode &t, int key) {
  if (t == NULL) return 0;
  pnode cur1, cur2;
  split(t, cur1, cur2, key);
  int res = sz(cur1);
  merge(t, cur1, cur2);
  return res;
}
inline void add(int type, int x, int y, int val) {
  for (; x < M; x |= (x + 1)) {
    insert(root[type][x], new node(y));
  }
}
inline int Sum(int type, int x, int y) {
  int res = 0;
  for (; x >= 0; x = (x & (x + 1)) - 1) res += get(root[type][x], y);
  return res;
}
long long bad[maxn];
int R() {
  char c;
  int ans = 0;
  bool started = 0, is_negative = 0;
  while (true) {
    c = getchar();
    if ((c < '0' || c > '9') && c != '-' && !started) continue;
    if ((c < '0' || c > '9') && c != '-' && started) break;
    if (started) ans = ans * 10;
    started = 1;
    if (c == '-')
      is_negative = 1;
    else
      ans += c - '0';
  }
  if (is_negative) ans = -ans;
  return ans;
}
inline void solve() {
  scanf("%d", &n);
  if (n == 2) {
    cout << "1\n1\n1 2 0";
    exit(0);
  }
  if (n == 3) {
    cout << "0\n1 2 0\n2 3 1\n1 3 2";
    exit(0);
  }
  for (int i = (1); i <= (n); ++i) {
    scanf("%d%d%d%d", &x1[i], &y11[i], &a, &b);
    x2[i] = x1[i] + a;
    y2[i] = y11[i] + b;
    vals.push_back(x1[i]);
    vals.push_back(x2[i]);
    vals.push_back(y11[i]);
    vals.push_back(y2[i]);
  }
  sort((vals).begin(), (vals).end());
  vals.resize(unique((vals).begin(), (vals).end()) - vals.begin());
  M = vals.size();
  for (int i = (0); i <= (maxn - 1); ++i)
    root[0][i] = root[1][i] = root[2][i] = root[3][i] = NULL;
  for (int i = (1); i <= (n); ++i) {
    x1[i] = lower_bound((vals).begin(), (vals).end(), x1[i]) - vals.begin();
    x2[i] = lower_bound((vals).begin(), (vals).end(), x2[i]) - vals.begin();
    y11[i] = lower_bound((vals).begin(), (vals).end(), y11[i]) - vals.begin();
    y2[i] = lower_bound((vals).begin(), (vals).end(), y2[i]) - vals.begin();
  }
  for (int i = (n); i >= (1); --i) {
    int c1 = get(0, x2[i] + 1, M - 1);
    int c2 = get(1, y2[i] + 1, M - 1);
    int c4 = get(2, x1[i] - 1);
    int c5 = get(3, y11[i] - 1);
    upd(0, x1[i], 1);
    upd(1, y11[i], 1);
    upd(2, x2[i], 1);
    upd(3, y2[i], 1);
    long long cur = c1 + c2 + c4 + c5;
    if (cur >= n - i) cur -= Sum(0, x1[i] - 1, y11[i] - 1);
    add(0, x2[i], y2[i], 1);
    if (cur >= n - i) cur -= Sum(1, M - x2[i] - 2, M - y2[i] - 2);
    add(1, M - x1[i] - 1, M - y11[i] - 1, 1);
    if (cur >= n - i) cur -= Sum(2, M - x2[i] - 2, y11[i] - 1);
    add(2, M - x1[i] - 1, y2[i], 1);
    if (cur >= n - i) cur -= Sum(3, x1[i] - 1, M - y2[i] - 2);
    add(3, x2[i], M - y11[i] - 1, 1);
    bad[i] = cur;
  }
  for (int i = (1); i <= (n); ++i) {
    puts(bad[i] == n - i ? "DA" : "NE");
  }
}
int main() {
  int tt = 1;
  for (int i = (1); i <= (tt); ++i) solve();
}
