#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int i;
    int one = 0, z = 0;
    for (i = 0; i < s.length(); i++) {
      if (s[i] == '1')
        ++one;
      else if (s[i] == '0')
        ++z;
    }
    int ct = min(one, z);
    if (ct & 1)
      cout << "DA"
           << "\n";
    else
      cout << "NET"
           << "\n";
  }
  return 0;
}
