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