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