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