#include <bits/stdc++.h>
using namespace std;
long long i, j;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    string St;
    cin >> St;
    long long a = 0, b = 0, c;
    for (auto m : St)
      if (m == '0')
        a++;
      else
        b++;
    c = min(a, b);
    if (c % 2 == 0)
      cout << "NET" << endl;
    else
      cout << "DA" << endl;
  }
  return 0;
}
