#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tst, n, x, cnt, cnt2, ans;
  cin >> tst;
  string a;
  while (tst--) {
    cin >> a;
    n = a.size();
    cnt = 0;
    cnt2 = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] == '0')
        cnt++;
      else
        cnt2++;
    }
    ans = min(cnt2, cnt);
    if (ans == 0)
      cout << "NET" << endl;
    else if (ans % 2)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
