#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  string s;
  cin >> t;
  while (t--) {
    cin >> s;
    int c0 = 0, c1 = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '0')
        c0++;
      else
        c1++;
    }
    if (c0 > 0 && c1 > 0 && min(c0, c1) % 2 == 1)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
