#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t, cnt1, cnt2, i, j;
  cin >> t;
  string s;
  for (i = 1; i <= t; i++) {
    cin >> s;
    cnt1 = 0;
    cnt2 = 0;
    for (j = 0; j < s.length(); j++) {
      if (s[j] == '0')
        cnt1++;
      else
        cnt2++;
      ;
    }
    if (min(cnt1, cnt2) % 2 == 1)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
