#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const long double PI = acosl(-1.0l);
const long long MAXN = numeric_limits<long long>::max();
const long long MINN = (1e9 + 1);
void solve() {
  string s;
  cin >> s;
  int n = s.size();
  int c0 = 0, c1 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0')
      c0++;
    else
      c1++;
  }
  if (c1 == 0 || c0 == 0)
    cout << "NET"
         << "\n";
  else {
    int x = min(c0, c1);
    {
      if (x % 2 == 1)
        cout << "DA\n";
      else if (x % 2 == 0)
        cout << "NET\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  int t = 1;
  cin >> t;
  while (t) {
    t--;
    solve();
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
