#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize "trapv"
struct point {
  long long int x, y;
};
double dis(point &a, point &b) {
  return sqrt(pow((a.x - b.x), 2) + pow((a.y - b.y), 2));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int test;
  cin >> test;
  while (test--) {
    string s;
    cin >> s;
    int one = 0;
    int ser = 0;
    for (auto j : s) {
      if (j == '0') {
        ser++;
      } else {
        one++;
      }
    }
    int t = min(one, ser);
    if (t % 2) {
      cout << "DA" << '\n';
    } else {
      cout << "NET" << '\n';
    }
  }
}
